ladybird/Userland/Libraries/LibWeb/DOM
Andreas Kling 22a858a0cb LibWeb: Don't parse inline style sheets during HTML fragment parsing
Some websites (like Reddit) like to instantiate "components" by setting
innerHTML to a huge chunk of stuff. Sometimes those huge chunks of stuff
contain inline style sheets (i.e `<style>` elements).

Before this change, we would end up parsing the CSS in those elements
multiple times, because we had no way of knowing that we were within
a fragment parser's temporary document.

This patch avoids the extra CSS parsing work by adding adding a flag to
Document that tells us it's being used by the fragment parser. Then, we
simply avoid parsing CSS for style elements in such documents. The CSS
then gets parsed immediately upon insertion into the proper DOM.
2023-08-09 17:09:28 +02:00
..
AbortController.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
AbortController.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
AbortController.idl
AbortSignal.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
AbortSignal.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
AbortSignal.idl
AbstractRange.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
AbstractRange.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
AbstractRange.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
AccessibilityTreeNode.cpp LibJS+LibWeb: Add missing visit calls in visit_edges implementations 2023-04-30 06:04:33 +02:00
AccessibilityTreeNode.h LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr 2023-03-15 08:48:49 +01:00
Attr.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
Attr.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
Attr.idl LibWeb: Rename Attribute to Attr 2022-09-18 02:08:01 +02:00
CDATASection.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
CDATASection.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
CDATASection.idl LibWeb: Add CDATASection 2022-06-27 22:53:04 +01:00
CharacterData.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
CharacterData.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
CharacterData.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
ChildNode.h LibWeb: Fix a few const-ness issues 2023-03-06 13:05:43 +00:00
ChildNode.idl LibWeb: Resolve circular IDL imports 2022-07-30 13:20:47 +02:00
Comment.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
Comment.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
Comment.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
CustomEvent.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
CustomEvent.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
CustomEvent.idl LibWeb: Port CustomEvent to new String 2023-04-07 22:41:01 +02:00
Document.cpp LibWeb: Allow (explicitly) converting CSSPixels to float and int 2023-08-08 14:58:26 +02:00
Document.h LibWeb: Don't parse inline style sheets during HTML fragment parsing 2023-08-09 17:09:28 +02:00
Document.idl LibWeb: Add a bunch of missing CEReactions 2023-04-06 11:36:56 +02:00
DocumentFragment.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
DocumentFragment.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
DocumentFragment.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
DocumentLoadEventDelayer.cpp LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated 2022-09-06 00:27:09 +02:00
DocumentLoadEventDelayer.h LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated 2022-09-06 00:27:09 +02:00
DocumentLoading.cpp LibWeb: Create an audio document for audio/ MIME types on navigation 2023-06-17 14:16:26 +02:00
DocumentLoading.h LibWeb: Implement "attempt to populate the history entry's document" 2023-05-03 09:39:49 +02:00
DocumentObserver.cpp LibWeb: Add an interface to be notified of Document state changes 2023-05-04 16:48:10 +02:00
DocumentObserver.h LibWeb: Rename loaded observer event to match spec 2023-07-12 13:16:23 +02:00
DocumentType.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
DocumentType.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
DocumentType.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
DOMEventListener.cpp LibJS+LibWeb: Normalize calls to Base::visit_edges in GC objects 2023-04-30 06:04:33 +02:00
DOMEventListener.h LibJS+LibWeb: Normalize calls to Base::visit_edges in GC objects 2023-04-30 06:04:33 +02:00
DOMImplementation.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
DOMImplementation.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
DOMImplementation.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
DOMTokenList.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
DOMTokenList.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
DOMTokenList.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
Element.cpp LibJS: Make PrimitiveString::utf8_string() infallible 2023-08-09 17:09:16 +02:00
Element.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
Element.idl LibWeb: Stub out Element.scroll() and Element.scrollTo() 2023-06-08 10:05:56 +02:00
ElementFactory.cpp LibWeb: Add support for SVG <tspan> elements 2023-07-23 06:32:39 +02:00
ElementFactory.h LibWeb: Introduce CustomElementRegistry and creating custom elements 2023-04-06 11:36:56 +02:00
Event.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
Event.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
Event.idl LibWeb: Port {Mouse,UI,Wheel,}Event to new String 2023-04-07 22:41:01 +02:00
EventDispatcher.cpp LibWeb: Port DOMEventListener to new FlyString 2023-04-09 17:27:27 +02:00
EventDispatcher.h LibWeb+LibJS: Make the EventTarget hierarchy (incl. DOM) GC-allocated 2022-09-06 00:27:09 +02:00
EventHandler.idl LibWeb: Implement WindowEventHandlers 2022-06-29 21:21:50 +01:00
EventTarget.cpp LibJS: Rip out the AST interpreter :^) 2023-08-08 13:07:13 +02:00
EventTarget.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
EventTarget.idl LibWeb: Implement the EventTarget constructor 2023-05-04 16:12:40 +02:00
HTMLCollection.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
HTMLCollection.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
HTMLCollection.idl
IDLEventListener.cpp LibWeb+LibJS: Move some code around to make CSS/Parser parse faster 2023-07-11 09:38:37 +03:30
IDLEventListener.h LibWeb: Make factory methods of IDLEventListener and NodeFilter fallible 2023-02-22 09:55:33 +01:00
InnerHTML.idl LibWeb: Resolve circular IDL imports 2022-07-30 13:20:47 +02:00
LiveNodeList.cpp LibWeb+LibJS: Move some code around to make CSS/Parser parse faster 2023-07-11 09:38:37 +03:30
LiveNodeList.h LibWeb: Make LiveNodeList faster when it only cares about children 2023-05-23 14:38:45 +02:00
MutationObserver.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
MutationObserver.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
MutationObserver.idl LibWeb: Introduce Mutation{Record,Observer} and observer microtasks 2022-07-11 22:35:08 +02:00
MutationRecord.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
MutationRecord.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
MutationRecord.idl LibWeb: Introduce Mutation{Record,Observer} and observer microtasks 2022-07-11 22:35:08 +02:00
MutationType.cpp AK: Make "foo"_fly_string infallible 2023-08-07 16:03:27 +02:00
MutationType.h AK: Make "foo"_fly_string infallible 2023-08-07 16:03:27 +02:00
NamedNodeMap.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
NamedNodeMap.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
NamedNodeMap.idl LibWeb: Add NamedNodeMap::setNamedItemNS() method 2022-12-17 18:27:57 +01:00
Node.cpp LibWeb: Add non-const version of paintable_box() in DOM::Node 2023-08-07 05:23:31 +02:00
Node.h LibWeb: Add non-const version of paintable_box() in DOM::Node 2023-08-07 05:23:31 +02:00
Node.idl LibWeb: Add a bunch of missing CEReactions 2023-04-06 11:36:56 +02:00
NodeFilter.cpp LibJS: Make intrinsics getters return NonnullGCPtr 2023-04-13 14:29:42 +02:00
NodeFilter.h LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr 2023-03-15 08:48:49 +01:00
NodeFilter.idl LibWeb: Expose NodeFilter on the Window object 2022-10-28 16:17:08 +01:00
NodeIterator.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
NodeIterator.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
NodeIterator.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
NodeList.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
NodeList.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
NodeList.idl
NodeOperations.cpp LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocate 2023-01-29 00:02:45 +00:00
NodeOperations.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
NonDocumentTypeChildNode.h
NonElementParentNode.h LibWeb: Fix a few const-ness issues 2023-03-06 13:05:43 +00:00
ParentNode.cpp LibWeb: Add namespaces to Universal and TagName selectors 2023-08-08 20:49:45 +01:00
ParentNode.h LibWeb: Allow SVG painting to escape out of a shadow tree 2023-06-03 05:58:00 +02:00
ParentNode.idl LibWeb: Resolve circular IDL imports 2022-07-30 13:20:47 +02:00
Position.cpp LibWeb: Skip over grapheme clusters on left/right arrow key presses 2023-03-01 14:24:01 +00:00
Position.h LibWeb: Convert Web::DOM::Position::to_deprecated_string to String 2023-03-01 14:24:01 +00:00
ProcessingInstruction.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
ProcessingInstruction.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
ProcessingInstruction.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
QualifiedName.cpp LibWeb: Introduce CustomElementRegistry and creating custom elements 2023-04-06 11:36:56 +02:00
QualifiedName.h LibWeb: Introduce CustomElementRegistry and creating custom elements 2023-04-06 11:36:56 +02:00
Range.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
Range.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
Range.idl LibWeb: Implement Range.createContextualFragment() 2023-03-10 14:58:55 +01:00
ShadowRoot.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
ShadowRoot.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
ShadowRoot.idl LibWeb: Make ShadowRoot.mode return ShadowRootMode instead of String 2023-02-02 14:43:29 +01:00
StaticNodeList.cpp LibWeb+LibJS: Move some code around to make CSS/Parser parse faster 2023-07-11 09:38:37 +03:30
StaticNodeList.h LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr 2023-03-15 08:48:49 +01:00
StaticRange.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
StaticRange.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
StaticRange.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
StyleElementUtils.cpp LibWeb: Don't parse inline style sheets during HTML fragment parsing 2023-08-09 17:09:28 +02:00
StyleElementUtils.h LibWeb: Extract updating a style block into StyleElementUtils 2023-06-09 17:14:50 +02:00
Text.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
Text.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
Text.idl LibWeb: Add Exposed attribute and IDL spec links where missing 2022-10-09 10:14:57 +02:00
TreeWalker.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
TreeWalker.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
TreeWalker.idl LibWeb: Remove the NoInstanceWrapper extended IDL attribute 2022-09-06 00:27:09 +02:00
XMLDocument.cpp LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
XMLDocument.h LibJS: Make Cell::initialize() return void 2023-08-08 07:39:11 +02:00
XMLDocument.idl LibWeb: Add XMLDocument stub 2023-04-21 07:59:50 +02:00