Bug 1367306 part 1 - Add an attribute in nsIDOMWindowUtils to check whether the document is styled by stylo. r=bholley

MozReview-Commit-ID: 6ed78DkzmT8

--HG--
extra : rebase_source : 52171f9e97a4472f6c2bed773aac16acb7289052
This commit is contained in:
Xidorn Quan 2017-06-21 15:24:55 +10:00
parent 65c5851591
commit e747170dc5
2 changed files with 15 additions and 0 deletions

View File

@ -4342,6 +4342,14 @@ nsDOMWindowUtils::GetDirectionFromText(const nsAString& aString, int32_t* aRetva
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetIsStyledByServo(bool* aStyledByServo)
{
nsIDocument* doc = GetDocument();
*aStyledByServo = doc && doc->IsStyledByServo();
return NS_OK;
}
NS_INTERFACE_MAP_BEGIN(nsTranslationNodeList)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_ENTRY(nsITranslationNodeList)

View File

@ -2026,6 +2026,13 @@ interface nsIDOMWindowUtils : nsISupports {
*/
long getDirectionFromText(in AString aString);
/**
* Whether the current document is styled by Servo's style engine.
*
* This calls nsIDocument::IsStyledByServo().
*/
readonly attribute boolean isStyledByServo;
// These consts are only for testing purposes.
const long DEFAULT_MOUSE_POINTER_ID = 0;
const long DEFAULT_PEN_POINTER_ID = 1;