code review re. #1202: mind style priority (repro case at #1575)

This commit is contained in:
gorhill 2016-04-19 09:15:06 -04:00
parent a8db9387e2
commit 62a4cafe2f
2 changed files with 9 additions and 10 deletions

View File

@ -134,10 +134,7 @@ svg > path + path {
stroke-width: 0.5px;
fill: rgba(255,63,63,0.20);
}
body.preview svg > path:first-child {
fill: rgba(0,0,0,0.10);
}
body.preview svg > path + path {
body.preview svg > path {
fill: rgba(0,0,0,0.10);
}
aside {

View File

@ -284,17 +284,19 @@ var filterElements = function(filter) {
previewedElements.push({
elem: elem,
prop: 'display',
value: style.display
value: style.getPropertyValue('display'),
priority: style.getPropertyPriority('display')
});
style.display = 'none';
style.setProperty('display', 'none', 'important');
}
if ( item.type === 'network' && item.style === 'background-image' ) {
previewedElements.push({
elem: elem,
prop: 'background-image',
value: style.backgroundImage
});
style.backgroundImage = 'none';
value: style.getPropertyValue('background-image'),
priority: style.getPropertyPriority('background-image')
});
style.setProperty('background-image', 'none', 'important');
}
}
};
@ -313,7 +315,7 @@ var unpreview = function() {
var i = items.length, item;
while ( i-- ) {
item = items[i];
item.elem.style[item.prop] = item.value;
item.elem.style.setProperty(item.prop, item.value, item.priority);
}
previewedElements.length = 0;
pickerBody.classList.remove('preview');