ladybird/Userland/Libraries/LibWeb/HTML/Parser
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
..
Entities.cpp Everywhere: Use nested namespace qualifiers 2023-07-12 10:05:42 +03:30
Entities.h Everywhere: Use nested namespace qualifiers 2023-07-12 10:05:42 +03:30
HTMLEncodingDetection.cpp LibWeb: Make factory method of DOM::Attr fallible 2023-02-18 00:52:47 +01:00
HTMLEncodingDetection.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
HTMLParser.cpp LibWeb: Don't parse inline style sheets during HTML fragment parsing 2023-08-09 17:09:28 +02:00
HTMLParser.h LibWeb: Add Web::HTML::parse_legacy_color_value 2023-05-28 13:24:37 +02:00
HTMLToken.cpp Everywhere: Rename to_{string => deprecated_string}() where applicable 2022-12-06 08:54:33 +01:00
HTMLToken.h Everywhere: Use AK_MAKE_DEFAULT_MOVABLE to avoid mistakes 2023-06-18 08:47:51 +01:00
HTMLTokenizer.cpp LibWeb: Don't include Layout/Node.h from DOM/Element.h 2023-05-08 09:29:44 +02:00
HTMLTokenizer.h LibJS+LibWeb: Wrap raw JS::Cell*/& fields in GCPtr/NonnullGCPtr 2023-03-15 08:48:49 +01:00
ListOfActiveFormattingElements.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
ListOfActiveFormattingElements.h Everywhere: Remove NonnullRefPtr.h includes 2023-03-06 23:46:35 +01:00
StackOfOpenElements.cpp AK+Everywhere: Rename FlyString to DeprecatedFlyString 2023-01-09 23:00:24 +00:00
StackOfOpenElements.h Everywhere: Remove NonnullRefPtr.h includes 2023-03-06 23:46:35 +01:00