Skip to content

Commit

Permalink
Bug 1558704 - Fix spellchecker when XUL is loaded as XHTML r=masayuki
Browse files Browse the repository at this point in the history
Temporary workaround to use the document element as the root content node
in XHTML pages that have a XUL root element.

Differential Revision: https://phabricator.services.mozilla.com/D34657
  • Loading branch information
Brendan Dahl committed Jun 13, 2019
1 parent 7a6a056 commit 883de87
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions editor/spellchecker/TextServicesDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,13 @@ Element* TextServicesDocument::GetDocumentContentRootNode() const {
}

if (mDocument->IsHTMLOrXHTML()) {
Element* rootElement = mDocument->GetRootElement();
if (rootElement && rootElement->IsXULElement()) {
// HTML documents with root XUL elements should eventually be transitioned
// to a regular document structure, but for now the content root node will
// be the document element.
return mDocument->GetDocumentElement();
}
// For HTML documents, the content root node is the body.
return mDocument->GetBody();
}
Expand Down

0 comments on commit 883de87

Please sign in to comment.