Bug 1428339: Make attribute mapping work without a pres context. r=heycam

MozReview-Commit-ID: FisYWoArX0N
This commit is contained in:
Emilio Cobos Álvarez
2018-01-05 13:47:04 +01:00
parent a275efd393
commit 3fb51af7bf
19 changed files with 100 additions and 101 deletions

View File

@@ -952,8 +952,7 @@ HTMLTableElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
// which *element* it's matching (style rules should not stop matching
// when the display type is changed).
nsPresContext* presContext = aData->PresContext();
nsCompatibility mode = presContext->CompatibilityMode();
nsCompatibility mode = aData->Document()->GetCompatibilityMode();
if (aData->ShouldComputeStyleStruct(NS_STYLE_INHERIT_BIT(TableBorder))) {
// cellspacing
@@ -999,8 +998,7 @@ HTMLTableElement::MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
// bordercolor
const nsAttrValue* value = aAttributes->GetAttr(nsGkAtoms::bordercolor);
nscolor color;
if (value && presContext->UseDocumentColors() &&
value->GetColorValue(color)) {
if (value && !aData->ShouldIgnoreColors() && value->GetColorValue(color)) {
aData->SetColorValueIfUnset(eCSSProperty_border_top_color, color);
aData->SetColorValueIfUnset(eCSSProperty_border_left_color, color);
aData->SetColorValueIfUnset(eCSSProperty_border_bottom_color, color);