Commit graph

419 commits

Author SHA1 Message Date
Simon Sapin
bf4480bb79 Simplify util::range::RangeIndex to always require std::num::Int,
and fix remaining warnings.
2014-12-18 11:34:23 +00:00
Simon Sapin
084a63df45 Remove usage of the deprecated std::num::Zero trait. 2014-12-18 11:16:47 +00:00
bors-servo
e2267e0a07 auto merge of #4358 : pcwalton/servo/cursor, r=mbrubeck
I'm not sure how we want to handle Linux cursors, and GLFW has no
ability to set cursors (short of disabling it and managing it yourself).

If you test this in the wild you will probably hit #4357 until that PR lands.
2014-12-18 00:24:49 -07:00
Patrick Walton
7371e0b8e3 compositing: Implement cursor per CSS3-UI § 8.1.1 in the CEF/Mac port.
I'm not sure how we want to handle Linux cursors, and GLFW has no
ability to set cursors (short of disabling it and managing it yourself).
2014-12-17 22:58:52 -08:00
Patrick Walton
a3f6f4e75b layout: Implement caption-side per CSS 2.1 § 17.4.1.
`caption-side` is used by 4% of pages by number of loads.
2014-12-17 22:06:14 -08:00
Patrick Walton
5675274c44 layout: Implement empty-cells per CSS 2.1 § 17.6.1.1. 2014-12-17 21:25:12 -08:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
Matthew Rasmus
504f968b20 Implements :indeterminate pseudo-class
Addresses reviews
2014-12-16 11:34:04 -08:00
bors-servo
905c30d697 auto merge of #4390 : Ms2ger/servo/derefs, r=jdm 2014-12-16 09:22:02 -07:00
Ms2ger
ac95d12037 Remove some manual deref() / deref_mut() calls. 2014-12-16 16:41:33 +01:00
Ms2ger
eafa8b48fc Fix bogus transmute. 2014-12-16 15:15:00 +01:00
bors-servo
8e31e5f987 auto merge of #4289 : pcwalton/servo/hacker-news, r=SimonSapin
This patch provides some of the groundwork for column spans greater than
1. It implements the column-span CSS property as well as the
corresponding colspan attribute; although the former is not
well-specified outside of CSS multi-column layout, INTRINSIC refers to
it. Although width is distributed to spanning columns, they do not yet
contribute minimum and preferred widths; this will be implemented in a
follow-up.

The parsing for the legacy bgcolor and border attributes is
implemented according to the WHATWG HTML specification.

Additionally, this patch cleans up some miscellaneous formatting issues,
refactors layout/css somewhat to eliminate needless levels of
indirection, and cleans up the handling of table rowgroups.

New Hacker News screenshot: http://i.imgur.com/hnl2a7E.png
2014-12-15 19:33:46 -07:00
bors-servo
88ec52dd61 auto merge of #4371 : pcwalton/servo/line-breaking-improvements, r=mbrubeck
This commit removes the "merge-fragments" pass from inline reflow,
instead merging "on the fly". This ended up being simpler, as well as
more fine grained. Additionally, this patch makes the line breaker no
longer clone every fragment (!)

This functionality will be used in the implementation of
`text-overflow`.

r? @mbrubeck
2014-12-15 19:09:49 -07:00
Patrick Walton
a1ea44b294 style: Address review comments relating to bgcolor and column spans 2014-12-15 18:09:44 -08:00
Patrick Walton
17835ba0cb style: Implement quirks mode rules. 2014-12-15 17:41:51 -08:00
Patrick Walton
56b78de5bc style: Implement basic column spans.
This patch provides some of the groundwork for column spans greater than
1. It implements the column-span CSS property (prefixed so as not to be
exposed to content) as well as the corresponding colspan attribute;
although the former is not well-specified outside of CSS multi-column
layout, INTRINSIC refers to it. Although width is distributed to
spanning columns, they do not yet contribute minimum and preferred
widths; this will be implemented in a follow-up.

Additionally, this patch cleans up some miscellaneous formatting issues
and improves the handling of table rowgroups.
2014-12-15 17:41:51 -08:00
Patrick Walton
14bafb11be style: Parse the legacy bgcolor attribute per the HTML5 specification.
Additionally, this patch cleans up some miscellaneous formatting issues.
2014-12-15 17:41:44 -08:00
Patrick Walton
10f1ed5e31 style: Parse the legacy border attribute per the legacy HTML specification.
Additionally, this patch cleans up some miscellaneous formatting issues
and refactors files in `layout/css/` somewhat to eliminate needless
levels of indirection. It also fixes our handling of presentational
hints that only apply if border is nonzero.
2014-12-15 17:41:37 -08:00
Patrick Walton
3029fbab92 layout: Implement basic lists and the CSS1 list properties.
The exact rendering is ill-spec'd. Some things are ugly (especially the
width and height of list style images) but they are infrequently used
and I believe this implementation matches the spec. Numeric lists are
not supported yet, since they will require a separate layout pass.

The implementation is a subclass of `BlockFlow`, on advice from Robert
O'Callahan.
2014-12-15 16:25:06 -08:00
bors-servo
7805fe19ed auto merge of #4318 : pcwalton/servo/box-shadow-redux, r=SimonSapin
r? @SimonSapin
2014-12-15 16:31:14 -07:00
Patrick Walton
a200b139b6 script: Add some workarounds for image cache task races 2014-12-15 14:16:20 -08:00
Patrick Walton
3ba0abd8ff gfx: Implement box-shadow per CSS-BACKGROUNDS. 2014-12-15 13:39:06 -08:00
Patrick Walton
42a8d9384b layout: Make line breaking able to restart from any position.
This commit removes the "merge-fragments" pass from inline reflow,
instead merging "on the fly". This ended up being simpler, as well as
more fine grained. Additionally, this patch makes the line breaker no
longer clone every fragment (!)

This functionality will be used in the implementation of
`text-overflow`.
2014-12-14 12:23:11 -08:00
Patrick Walton
6943ddb93e layout: Implement overflow-wrap/word-wrap per CSS-TEXT § 6.2.
This property is used by approximately 55% of page loads.

To implement the line breaking behavior, the "breaking strategy" has
been cleaned up and abstracted. This should allow us to easily support
other similar properties in the future, such as `text-overflow` and
`word-break`.
2014-12-13 13:05:05 -08:00
Patrick Walton
106fdb1d32 layout: Implement word-spacing per CSS 2.1 § 16.4.
This assumes that there are no ligatures that span across multiple
words. Since we have a per-word shape cache, this is a safe assumption
as of now. I have left comments to ensure that, if and when this is
revisted, we make sure to handle it properly.
2014-12-12 17:55:11 -08:00
Patrick Walton
caee309ef4 layout: Implement text-indent per CSS 2.1 § 16.1.
I had to use a somewhat unconventional method of computing text
indentation (propagating from blocks down to inlines) because of the way
containing blocks are handled in Servo.

(As a side note, neither Gecko nor WebKit correctly handles percentages
in `text-align`, at least incrementally -- i.e. when the percentages are
relative to the viewport and the viewport is resized.)
2014-12-12 14:55:41 -08:00
Patrick Walton
071d320728 layout: Refactor inline layout a bit. 2014-12-12 14:55:24 -08:00
Patrick Walton
07bc97e3e2 gfx: Implement letter-spacing per CSS 2.1 § 16.4.
The ligature disabling code has been manually verified, but I was unable
to reftest it. (The only way I could think of would be to create an
Ahem-like font with a ligature table, but that would be an awful lot of
work.)

Near as I can tell, the method used to apply the spacing (manually
inserting extra advance post-shaping) matches Gecko.
2014-12-12 11:43:43 -08:00
Joseph Crail
c254d195ad Fix spelling mistakes in comments. 2014-12-11 23:56:29 -05:00
bors-servo
909dd0e80f auto merge of #4339 : pcwalton/servo/refactor-tables, r=mbrubeck
By "idempotent" I mean that later passes do not stomp on data from
earlier passes, so that we can run the passes individually for
incremental reflow. The main change here was to stop overwriting the
"minimum inline-size" field of each column with the column's computed
inline-size.

r? @mbrubeck
2014-12-11 18:06:53 -07:00
Patrick Walton
52b9951cad layout: Implement outline per CSS 2.1 § 18.4.
`invert` is not yet supported.

Objects that get layers will not yet display outlines properly. This is
because our overflow calculation doesn't take styles into account and
because layers are always anchored to the top left of the border box.
Since fixing this is work that is not related to outline *per se* I'm
leaving that to a followup and making a note in the code.
2014-12-11 14:25:10 -08:00
Patrick Walton
3cddaf8da6 layout: Make table layout idempotent.
By "idempotent" I mean that later passes do not stomp on data from
earlier passes, so that we can run the passes individually for
incremental reflow. The main change here was to stop overwriting the
"minimum inline-size" field of each column with the column's computed
inline-size.
2014-12-11 14:24:55 -08:00
bors-servo
9bf1d1862a auto merge of #4311 : pcwalton/servo/text-transform, r=SimonSapin
The Unicode awareness of `text-transform` is implemented as well as
possible given the Rust standard library's Unicode support. In
particular, the notion of an alphabetic character is used instead of a
letter.

Gecko has a subclass of text run to handle text transforms, but I
implemented this in a simpler way.

r? @SimonSapin
2014-12-10 15:12:58 -07:00
Patrick Walton
877f02f1d1 layout: Implement text-transform.
The Unicode awareness of `text-transform` is implemented as well as
possible given the Rust standard library's Unicode support. In
particular, the notion of an alphabetic character is used instead of a
letter.

Gecko has a subclass of text run to handle text transforms, but I
implemented this in a simpler way.
2014-12-10 14:09:08 -08:00
Martin Robinson
2e8f1c08fa Remove PseudoDisplayItemClass
Now that content box queries are made against the flow tree, we can
remove PseudoDisplayItems from the display list.
2014-12-10 11:39:17 +01:00
Matt Brubeck
5d0d11c380 Make all of LineBreaker private 2014-12-09 15:57:05 -08:00
Matt Brubeck
51850c7ab6 Remove unused code in assign_block_size_block_base
This code is unreachable because an earlier `if base(kid).flags.is_float()`
check bails out of the loop before it can reach this block.
2014-12-09 15:50:18 -08:00
bors-servo
5c506f7a98 auto merge of #4194 : cgaebel/servo/incremental-reflow-fix, r=pcwalton
When inserting a node that was already dirtied, the dirtying logic
would short circuit: "This node is already dirty? Great! Then its
parents must be HAS_DIRTY_DESCENDANTS, too! Let's skip that step."

This isn't appropriate when nodes move around the tree. In that case,
the node may be marked HAS_CHANGED, but ancestors may not yet have
the HAS_DIRTY_DESCENDANTS flag set.

This patch adds a `content_and_heritage_changed` hook in the document,
to deal with these cases appropriately.
2014-12-08 12:28:14 -07:00
bors-servo
f18c18371d auto merge of #4190 : mttr/servo/checked_pseudo_class, r=Manishearth
Relevant spec:
https://html.spec.whatwg.org/multipage/scripting.html#selector-checked

Also modifies HTMLInputElement::SetChecked to no longer modify its
checked content value, instead making use of its internal checkedness
state now that we can match `:checked` properly.
2014-12-08 12:01:51 -07:00
Matthew Rasmus
1b84bd22b8 Implements the :checked pseudo-class for inputs
Relevant spec:
https://html.spec.whatwg.org/multipage/scripting.html#selector-checked

Also modifies HTMLInputElement::SetChecked to no longer modify its
checked content value, instead making use of its internal checkedness
state now that we can match `:checked` properly.
2014-12-08 08:40:15 -08:00
Tetsuharu OHZEKI
9cda2c3395 Replace almost "render" to "paint" in layout crate.
This doesn't touch some "render" words which are used as general means.
2014-12-08 15:00:57 +09:00
Tetsuharu OHZEKI
79722bdc03 Rename gfx::paint_task::Msg 2014-12-08 14:05:50 +09:00
Tetsuharu OHZEKI
7ff790d941 Rename RenderChan -> PaintChan 2014-12-08 14:05:50 +09:00
Tetsuharu OHZEKI
cee3d517e8 Rename RenderLayer -> PaintLayer 2014-12-08 14:05:49 +09:00
Tetsuharu OHZEKI
daba904302 Rename gfx/render_task.rs -> gfx/paint_task.rs 2014-12-08 11:46:43 +09:00
bors-servo
bc7b5b35b4 auto merge of #4234 : tterribe/servo/issue4158, r=metajack
This makes these parameters self-documenting.
This patch does not attempt to push those enums into the data
structures that feed calls to this function.

Fixes #4158.
2014-12-05 17:34:03 -07:00
Timothy B. Terriberry
65575bf8a7 Change time::profile's meta booleans to enums.
This makes these parameters self-documenting.
This patch does not attempt to push those enums into the data
structures that feed calls to this function.

Fixes #4158.
2014-12-05 14:23:27 -08:00
Matthew Rasmus
ed37b53a62 Updates WPT to expect newly passing tests
Addresses reviews

More review addressing
2014-12-05 12:31:31 -08:00
Matthew Rasmus
29241699fd Implements multi line text input for TextArea 2014-12-05 12:21:31 -08:00
Corey Richardson
4d55ab8157 Don't categorize HTMLInputElement as a TableCellFragment
Closes  #4196.
2014-12-03 21:44:18 -08:00