mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
LibWeb: Implement quirks mode detection
This allows us to determine which mode to render the page in. Exposes "doctype" and "compatMode" on Document. Exposes "name", "publicId" and "systemId" on DocumentType.
This commit is contained in:
parent
a5ecb9bd6b
commit
19d6884529
13 changed files with 196 additions and 6 deletions
|
@ -477,4 +477,20 @@ void Document::adopt_node(Node& subtree_root)
|
|||
});
|
||||
}
|
||||
|
||||
const DocumentType* Document::doctype() const
|
||||
{
|
||||
return first_child_of_type<DocumentType>();
|
||||
}
|
||||
|
||||
const String& Document::compat_mode() const
|
||||
{
|
||||
static String back_compat = "BackCompat";
|
||||
static String css1_compat = "CSS1Compat";
|
||||
|
||||
if (m_quirks_mode == QuirksMode::Yes)
|
||||
return back_compat;
|
||||
|
||||
return css1_compat;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue