Commit graph

3899 commits

Author SHA1 Message Date
Yusuke Suzuki
55cc9ccf22 Restart selector matching from an appropriate compound selector
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".
2014-04-05 00:07:33 +09:00
bors-servo
f34a64049a auto merge of #1978 : huonw/servo/less-transmute, r=Ms2ger
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`).
2014-03-25 14:46:37 -04:00
bors-servo
a8e1059f44 auto merge of #1977 : mbrubeck/servo/task-name, r=jdm
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.)
2014-03-25 14:13:41 -04:00
bors-servo
fd5e5cd18b auto merge of #1973 : june0cho/servo/table_rebase, r=larsbergstrom,metajack
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)
2014-03-25 13:40:47 -04:00
bors-servo
11639c34e6 auto merge of #1958 : mbrubeck/servo/macro-crate, r=kmcallister
This moves the bitfield! macro into a new shared `macros` crate as suggested in #1882.
2014-03-25 12:37:49 -04:00
Matt Brubeck
00ca300305 Set a name for WorkQueue tasks (fixes #1830) 2014-03-25 07:33:02 -07:00
Huon Wilson
94e4ab3eaf Remove some unnecessary transmutes.
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`).
2014-03-25 22:23:55 +11:00
Junyoung Cho
48b36e5b3a Support a part of anonymous table(step 1-1, 1-2, 2).
Not Covered: step 1-3, 1-4, 3-1, 3-2
*Spec: http://www.w3.org/TR/CSS21/tables.html#anonymous-boxes
2014-03-24 16:14:31 +09:00
Junyoung Cho
008be170d4 Construct table-related flow and calculate fixed layout 2014-03-24 16:14:27 +09:00
Youngsoo Son
e5333fca2d Add fixed table test cases 2014-03-24 15:49:12 +09:00
Junyoung Cho
8dbec50178 Refactor assign_height and assign_width for block flow. 2014-03-24 15:49:12 +09:00
bors-servo
3401a568f2 auto merge of #1966 : lpy/servo/issue1955, r=jdm
see #1955
2014-03-23 13:25:42 -04:00
bors-servo
e67d8a4003 auto merge of #1947 : saneyuki/servo/cast, r=jdm
follow up https://github.com/mozilla/servo/pull/1864#issuecomment-37109672
2014-03-23 11:46:47 -04:00
Tetsuharu OHZEKI
cfb2af60d8 Annotate 'inline' to TCast::to/to_unchecked/from. 2014-03-23 23:12:12 +09:00
bors-servo
de67069b0a auto merge of #1965 : jdm/servo/harnessfix, r=Ms2ger 2014-03-22 17:07:46 -04:00
bors-servo
21dc875708 auto merge of #1967 : lpy/servo/issue1960, r=Ms2ger
see #1960
2014-03-22 16:43:52 -04:00
lpy
f6d912a94f Remove |unused| field from DOMClass.(fixes #1960) 2014-03-22 15:17:44 +08:00
lpy
2fe92bf7ba Make JS<T>::clone inline.(fixes #1955) 2014-03-22 14:57:55 +08:00
bors-servo
599d04b106 auto merge of #1953 : pradeep90/servo/fix-width-computer-allocation, r=pcwalton
This fixes #1928
2014-03-22 02:49:35 -04:00
bors-servo
7bd3ba9e1b auto merge of #1963 : jdm/servo/revert, r=jdm
This reverts commit f1394e3ffc.
2014-03-22 02:22:38 -04:00
Josh Matthews
16d1d65b03 Watch for test failures, not just I/O errors. 2014-03-22 02:12:43 -04:00
Josh Matthews
25d3c9078e Revert "Set a name for WorkQueue tasks (fixes #1830)"
This reverts commit f1394e3ffc.
2014-03-22 01:33:54 -04:00
bors-servo
ee88817461 auto merge of #1948 : mbrubeck/servo/task-name, r=jdm
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...)?
2014-03-21 18:40:36 -04:00
Matt Brubeck
f1394e3ffc Set a name for WorkQueue tasks (fixes #1830) 2014-03-21 15:36:02 -07:00
Matt Brubeck
79ca9b6eb0 Move common macros into a new crate (fixes #1882) 2014-03-21 14:54:56 -07:00
bors-servo
54da52fa77 auto merge of #1950 : Ms2ger/servo/nullable-string-with-null-default, r=jdm 2014-03-21 06:49:34 -04:00
S Pradeep Kumar
a24a7506f2 Remove unnecessary allocation in width-computation. 2014-03-21 17:20:12 +09:00
bors-servo
5dbde0c5c5 auto merge of #1951 : Ms2ger/servo/castable, r=jdm 2014-03-20 23:13:34 -04:00
Ms2ger
6ee2e29e62 Make unwrap and unwrap_object less generic. 2014-03-20 23:26:22 +01:00
Ms2ger
a4fc6961a8 Remove support for non-castable arguments. 2014-03-20 23:17:46 +01:00
Ms2ger
acffed2dcd Fix code generation for a null default value for nullable string arguments. 2014-03-20 22:51:31 +01:00
bors-servo
7bfb15ec62 auto merge of #1949 : Ms2ger/servo/cleanup-codegen, r=jdm 2014-03-20 17:07:28 -04:00
Ms2ger
077243caa7 Stop returning None from getRetvalDeclarationForType and update documentation. 2014-03-20 21:14:28 +01:00
Ms2ger
322893009d Make the result and result_fallible variables immutable. 2014-03-20 21:06:55 +01:00
Ms2ger
eec2e10d9c Remove the declareResult argument to CGCallGenerator's constructor. 2014-03-20 20:34:52 +01:00
Ms2ger
ad086ba7da Use CGIfElseWrapper in a few more places. 2014-03-20 20:32:16 +01:00
Ms2ger
904e8eaf17 Remove the codeToSetNull argument to wrapObjectTemplate. 2014-03-20 20:27:30 +01:00
Ms2ger
022dfa0a5e Remove the preSuccess and postSuccess arguments to getJSToNativeConversionTemplate.
They were used for unions until 06f9afdad5.
2014-03-20 20:16:39 +01:00
Ms2ger
4ba093939a Remove unused import of std::intrinsics::uninit. 2014-03-20 20:16:38 +01:00
bors-servo
509ff7e52f auto merge of #1913 : Ms2ger/servo/attributes, r=jdm 2014-03-20 14:46:34 -04:00
Ms2ger
038a195ead Move attributes-related functions onto JS<Element>. 2014-03-20 19:42:42 +01:00
bors-servo
0265fb9784 auto merge of #1867 : saneyuki/servo/1828, r=pcwalton
Fix #1828
2014-03-20 14:10:54 -04:00
Tetsuharu OHZEKI
e9e7441c0a Change from TNode/TElement::with_element() to as_element(). 2014-03-21 00:00:51 +09:00
bors-servo
8317122068 auto merge of #1864 : saneyuki/servo/split_cast_to, r=jdm
fix #1836
2014-03-20 10:58:36 -04:00
Tetsuharu OHZEKI
0fccf5e386 Split TCast::to into TCast::to_unchecked and TCast::to. 2014-03-20 23:41:59 +09:00
bors-servo
2fb8c84bac auto merge of #1943 : lpy/servo/issue1933, r=jdm
see #1933
2014-03-20 10:19:30 -04:00
bors-servo
9e53b4d828 auto merge of #1945 : Ms2ger/servo/1196-isDefinitelyObject, r=jdm
... and fix nearby whitespace (fixes #1196).
2014-03-20 09:40:32 -04:00
Ms2ger
bdfd89508a Pass the isDefinitelyObject argument to wrapObjectTemplate and fix nearby whitespace (fixes #1196). 2014-03-20 11:53:01 +01:00
bors-servo
19a7c429a1 auto merge of #1944 : lpy/servo/issue1938, r=Ms2ger
see #1938
2014-03-20 06:34:32 -04:00
lpy
34b73837d3 Rename squirrel_away_unboxed to squirrel_away_unique.(fixes #1938) 2014-03-20 17:14:31 +08:00