Bug 1341714 - Part 2: stylo: Add support for <table> color quirk ; r=heycam
MozReview-Commit-ID: 56IKARwfbhw
This commit is contained in:
@@ -1673,7 +1673,7 @@ fails == 641770-1.html 641770-1.html
|
||||
fails == 645491-1.html 645491-1.html
|
||||
fails == 645647-1.html 645647-1.html
|
||||
== 645647-2.html 645647-2.html
|
||||
fails == 645768-1.html 645768-1.html
|
||||
== 645768-1.html 645768-1.html
|
||||
== 650228-1.html 650228-1.html
|
||||
needs-focus == 652301-1a.html 652301-1a.html
|
||||
needs-focus == 652301-1b.html 652301-1b.html
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "nsIContentInlines.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDocumentInlines.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIPresShell.h"
|
||||
@@ -48,6 +49,7 @@
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/ElementInlines.h"
|
||||
#include "mozilla/dom/HTMLTableCellElement.h"
|
||||
#include "mozilla/dom/HTMLBodyElement.h"
|
||||
#include "mozilla/LookAndFeel.h"
|
||||
|
||||
using namespace mozilla;
|
||||
@@ -523,6 +525,12 @@ Gecko_FillAllMaskLists(nsStyleImageLayers* aLayers, uint32_t aMaxLen)
|
||||
nsRuleNode::FillAllMaskLists(*aLayers, aMaxLen);
|
||||
}
|
||||
|
||||
RawGeckoElementBorrowedOrNull
|
||||
Gecko_GetBody(RawGeckoPresContextBorrowed aPresContext)
|
||||
{
|
||||
return aPresContext->Document()->GetBodyElement();
|
||||
}
|
||||
|
||||
nscolor Gecko_GetLookAndFeelSystemColor(int32_t aId,
|
||||
RawGeckoPresContextBorrowed aPresContext)
|
||||
{
|
||||
|
||||
@@ -378,6 +378,8 @@ nsCSSFontFaceRule* Gecko_CSSFontFaceRule_Create();
|
||||
void Gecko_CSSFontFaceRule_GetCssText(const nsCSSFontFaceRule* rule, nsAString* result);
|
||||
NS_DECL_FFI_REFCOUNTING(nsCSSFontFaceRule, CSSFontFaceRule);
|
||||
|
||||
RawGeckoElementBorrowedOrNull Gecko_GetBody(RawGeckoPresContextBorrowed pres_context);
|
||||
|
||||
// We use an int32_t here instead of a LookAndFeel::ColorID
|
||||
// because forward-declaring a nested enum/struct is impossible
|
||||
nscolor Gecko_GetLookAndFeelSystemColor(int32_t color_id,
|
||||
|
||||
@@ -176,8 +176,21 @@ ServoStyleSet::GetContext(already_AddRefed<ServoComputedValues> aComputedValues,
|
||||
// See bug 1344914.
|
||||
bool skipFixup = false;
|
||||
|
||||
return NS_NewStyleContext(aParentContext, mPresContext, aPseudoTag,
|
||||
aPseudoType, Move(aComputedValues), skipFixup);
|
||||
RefPtr<nsStyleContext> result = NS_NewStyleContext(aParentContext, mPresContext, aPseudoTag,
|
||||
aPseudoType, Move(aComputedValues), skipFixup);
|
||||
|
||||
// Set the body color on the pres context. See nsStyleSet::GetContext
|
||||
if (aElementForAnimation &&
|
||||
aElementForAnimation->IsHTMLElement(nsGkAtoms::body) &&
|
||||
aPseudoType == CSSPseudoElementType::NotPseudo &&
|
||||
mPresContext->CompatibilityMode() == eCompatibility_NavQuirks) {
|
||||
nsIDocument* doc = aElementForAnimation->GetUncomposedDoc();
|
||||
if (doc && doc->GetBodyElement() == aElementForAnimation) {
|
||||
// Update the prescontext's body color
|
||||
mPresContext->SetBodyTextColor(result->StyleColor()->mColor);
|
||||
}
|
||||
}
|
||||
return result.forget();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user