Introducing 3 matching failure statuses,
NotMatchedAndRestartFromClosestLaterSibling
NotMatchedAndRestartFromClosestDescendant
NotMatchedGlobally
When NotMatchedGlobally appears, stop selector matching completely since
the succeeding selector never matches.
It is raised when
Child combinator cannot find the candidate element
Descendant combinator cannot find the candidate element
When NotMatchedAndRestartFromClosestDescendant appears, the selector
matching does backtracking and restarts from the closest Descendant
combinator.
It is raised when
NextSibling combinator cannot find the candidate element.
LaterSibling combinator cannot find the candidate element.
Child combinator doesn't match on the found element.
When NotMatchedAndRestartFromClosestLaterSibling appears, the selector
matching does backtracking and restarts from the closest LaterSibling
combinator.
It is raised when
NextSibling combinator doesn't match on the found element.
For example, when the selector "d1 d2 a" is provided and we cannot *find*
an appropriate ancestor node for "d1", this selector matching raises
NotMatchedGlobally since even if "d2" is moved to more upper node, the
candidates for "d1" becomes less than before and d1 .
The next example is siblings. When the selector "b1 + b2 ~ d1 a" is
providied and we cannot *find* an appropriate brother node for b1,
the selector matching raises NotMatchedAndRestartFromClosestDescendant.
The selectors ("b1 + b2 ~") doesn't match and matching restart from "d1".
The additional example is child and sibling. When the selector
"b1 + c1 > b2 ~ d1 a" is provided and the selector "b1" doesn't match on
the element, this "b1" raises NotMatchedAndRestartFromClosestLaterSibling.
However since the selector "c1" raises
NotMatchedAndRestartFromClosestDescendant. So the selector
"b1 + c1 > b2 ~ " doesn't match and restart matching from "d1".
These can either be done by implicit `&` -> `*` coercions, explicit `*`
-> `*` casts, or an explicit `&*x` `*` -> `&` re-borrow (which is still
unsafe, but significantly more controlled compared to a `transmute`).
Now with 100% less breaking everything. (An earlier version of this patch in #1948 switched WorkQueue from native tasks to green tasks, which I missed in testing because we don't spawn new layout threads by default on 1- or 2-core machines.)
This is a rebase of #1548 on recent master.
There have been many changes since #1548 is first uploaded, so I'm creating new PR.
This PR includes:
- construction of table-* flows (table-wrapper, table-caption, table, table-rowgroup, table-row, table-cell)
- fixed-layout table calculation
- a part of anonymous table object implementation
[CSS 2.1, 17.2.1](http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes) (Step 1-1, 1-2, Step 2)
These can either be done by implicit `&` -> `*` coercions, explicit `*`
-> `*` casts, or an explicit `&*x` `*` -> `&` re-borrow (which is still
unsafe, but significantly more controlled compared to a `transmute`).
This is my first Servo patch. Please don't hesitate to offer basic Rust tips.
Note: This assigns the same name to all of the worker tasks for a given WorkQueue. Would it be useful to generate a unique name for each tasks (LayoutWorker1, LayoutWorker2...)?