Fix CSS.supports for origin trial enabled property/value
- currently when CSS.supports is called it does not pass in the ExecutionContext to the css parser context, hence it does not support Origin Trial enabled properties/values. - This changeset added plumbing to pass in the top level document to CSSParserContext which we extracted from ExecutionContext. - Repurposed one of the ParseValue overload and change all its callsite to pass in ExecutionContext, they were previously passing in ExecutionContext->GetSecureContext() - CSSParserContext used in support parsing are constructed using the document if the execution context belongs to one. We then override the parser mode to kHTMLStandardMode as quirks mode values must not be supported in CSS.supports method according to https://quirks.spec.whatwg.org/#css This is also in line with current behaviours before document is added to the context. - Added virtual test that checks for CSS.supports(condition) and CSS.supports(property, value) Bug: 1134237 Change-Id: I4c1b3cd2707f3ce5495ee298a909e3f42946fc09 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2477014Reviewed-by:Jeremy Roman <jbroman@chromium.org> Reviewed-by:
Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by:
Jason Chase <chasej@chromium.org> Commit-Queue: Rodney Ding <rodneyding@google.com> Cr-Commit-Position: refs/heads/master@{#821909}
Showing
Please register or sign in to comment