1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 19:05:07 +00:00
Commit graph

21 commits

Author SHA1 Message Date
Andreas Kling
63814ffebf LibHTML: Move CSS value parsing to CSSParser. 2019-07-04 15:49:16 +02:00
Andreas Kling
8ac2b30de7 LibHTML: Add LengthStyleValue and create those when parsing number values. 2019-07-03 07:55:22 +02:00
Andreas Kling
33ac0de988 LibHTML: Add Length and LengthBox classes.
We need a way to represent values that are "auto", so adding a Length class
seems like the easiest way to achieve that.
2019-07-01 17:17:32 +02:00
Andreas Kling
7a9d5e2a69 LibHTML: Let's not support CSS shorthand properties right away.
This will simplify style building right now, and we can come back later
and implement shorthand expansion.
2019-07-01 07:33:21 +02:00
Andreas Kling
7eef69ad4b LibHTML: Refactor to go from DOM -> styled tree -> layout tree.
Frame::layout() drives everything now, it takes the DOM contained in the
frame and puts it through the tree transformations.
2019-06-29 21:42:07 +02:00
Andreas Kling
9a7dc06567 LibHTML: Add Selector::specificity(), which returns a Specificity object. 2019-06-29 17:32:32 +02:00
Andreas Kling
ffcbe8f0de LibHTML: Start building the style tree.
Walk the DOM and construct a parallel style tree that points back to the DOM
and has the relevant CSS property values hanging off of them.

The values are picked based on naive selector matching. There's no cascade
or specificity taken into account yet.
2019-06-28 21:25:44 +02:00
Andreas Kling
e971f5604c LibHTML: Implement some very simple selector matching.
We walk the entire DOM and check all selectors against all elements. Only
id, class and tag name are checked right now. There's no ancestor stack
or compound selectors. All in good time :^)
2019-06-27 20:40:21 +02:00
Andreas Kling
2b4eea5a50 LibHTML: Start fleshing out a StyleResolver class.
This will be responsible for matching selectors and creating LayoutStyle
objects for the document and its elements.
2019-06-27 17:47:59 +02:00
Andreas Kling
7cc9ce8380 LibHTML: Use NonnullRefPtrVector in LibHTML. 2019-06-27 12:16:20 +02:00
Andreas Kling
7a3f59ae3f LibHTML: Add a StyledNode class.
I'd like to try doing DOM -> style tree -> layout tree. I'm not exactly sure
how it's gonna work, but we'll figure it out as we go.
2019-06-27 08:37:47 +02:00
Andreas Kling
6469d7f043 LibHTML: Flesh out the code to dump a StyleSheet object graph. 2019-06-25 06:31:47 +02:00
Andreas Kling
4573eb226e LibHTML: Implement enough of the CSS parser to parse the default stylesheet. 2019-06-22 21:48:56 +02:00
Andreas Kling
ae8eff55a7 LibHTML: Some initial works towards a simple CSS parser. 2019-06-22 09:27:39 +02:00
Andreas Kling
891e668e35 LibHTML: Add an empty CSS parser. 2019-06-21 20:55:41 +02:00
Andreas Kling
85d71024f7 LibHTML: Add a basic default UA stylesheet.
We can't parse this yet, but we have to start somewhere. :^)
2019-06-21 20:27:11 +02:00
Andreas Kling
02e02ca3a5 LibHTML: More work on the CSS object model. 2019-06-21 19:19:49 +02:00
Andreas Kling
d343fb2429 AK: Rename Retainable.h => RefCounted.h. 2019-06-21 18:58:45 +02:00
Andreas Kling
90b1354688 AK: Rename RetainPtr => RefPtr and Retained => NonnullRefPtr. 2019-06-21 18:37:47 +02:00
Andreas Kling
77b9fa89dd AK: Rename Retainable => RefCounted.
(And various related renames that go along with it.)
2019-06-21 15:30:03 +02:00
Andreas Kling
d99b1a9ea0 LibHTML: Add the outline of a CSS stylesheet object graph. 2019-06-20 23:25:25 +02:00