Commit graph

31 commits

Author SHA1 Message Date
Patrick Walton
4b9cd4e65d layout: Implement <table width> and <center>.
Improves Hacker News.
2015-05-11 12:53:45 -07:00
Ms2ger
34e35df986 Move get_attr and get_attrs into TElementAttributes.
These methods are only called on LayoutElement.
2015-05-10 18:26:06 +02:00
Simon Sapin
b1ecba9f3d Use i32 instead of isize in Au methods. 2015-05-05 18:40:00 +02:00
Simon Sapin
ef8edd4e87 Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8. 2015-05-05 10:07:34 -04:00
Ms2ger
903305416a Implement Clone for Copy types. 2015-04-28 23:31:10 +02:00
Ms2ger
e3440c8a59 Move bgcolor over to the new infrastructure.
Note that I call is_htmltabledatacellelement in
synthesize_presentational_hints_for_legacy_attributes, rather than
is_htmltablecellelement (which was used in
get_simple_color_attribute_for_layout), because that function was never called
for th elements.
2015-04-26 22:25:11 +02:00
Ms2ger
582ee1c2b3 Create a new infrastructure for presentational hints. 2015-04-26 21:25:06 +02:00
Patrick Walton
79336d21b5 style: Disregard the size attribute for input elements other than text
or password fields.

HTML5 § 4.10.5.3.2 doesn't explicitly say to do this, but all other
browser engines seem to do it.

Improves the Google home page.
2015-04-24 17:33:53 -07:00
Corey Farwell
8b08c6f43f Don't link to specific WHATWG multipage page
"Links to the multipage version of the specification are unfortunately
likely to break over time."
-- https://html.spec.whatwg.org/multipage/asefij.html

This commit removes all references to the specific pages when viewing
WHATWG using multipage mode. I went through all these links and they
redirect fine.

Regex used to generate this commit:

`s_whatwg.org/multipage/.*#_whatwg.org/multipage/#_g`
2015-04-16 22:39:25 -04:00
Ms2ger
9aa9a3b8fd Stop using int and uint in style. 2015-04-05 19:13:01 +02:00
Ms2ger
5f15eb5fbf Upgrade rustc to d3c49d2140fc65e8bb7d7cf25bfe74dda6ce5ecf/rustc-1.0.0-dev. 2015-03-18 13:18:31 -04:00
Patrick Walton
586c12ccc4 layout: Implement border-spacing per CSS 2.1 § 17.6.1 and the legacy
`cellspacing` attribute per HTML5 § 14.3.9.

Table layout code has been refactored to push the spacing down to
rowgroups and rows; this will aid the implementation of
`border-collapse` as well.

This commit also fixes two nasty issues in table layout:

* In fixed layout, extra space would not be divided among columns that
  had auto width but had nonzero minimum width.

* In automatic layout, extra space would be distributed to constrained
  columns as well even if unconstrained columns with percentage equal to
  zero were present.
2015-03-12 12:00:40 -07:00
James Gilbertson
41786c4cb4 Refactor style::values::specified::Length to store length by kind (absolute, font-relative or character width) 2015-03-05 07:09:10 -07:00
Simon Sapin
2a50755c8a Move selector matching to an external library, for use outside Servo. 2015-02-23 16:29:34 +01:00
Simon Sapin
be599158e0 Do "computed value" calculation with a trait with an associated type. 2015-02-20 21:32:01 +01:00
Ms2ger
505159a464 Import the util crate as util rather than servo_util.
This used to conflict with the util crate from the standard library, which
has long since been removed.

The import in layout has not been changed because of a conflict with the
util mod there.
2015-01-29 12:16:41 +01:00
Josh Matthews
95fc29fa0d Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev. 2015-01-28 10:16:49 +10:00
Simon Sapin
d034a6c6bc Port to the new cssparser.
https://github.com/servo/rust-cssparser/pull/68
2015-01-21 22:23:46 +01:00
Ms2ger
16c7060bc8 Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19. 2015-01-08 09:58:46 -05:00
bors-servo
824788649c auto merge of #4342 : jdm/servo/cssom, r=jdm,metajack
This does not implement any notion of CSSStyleDeclaration objects that do not have an owning element; there's no actual CSS object model in play here. This does support setting and getting properties of the style attribute for HTMLElement, and tries to implement the ambiguous CSS value serialization spec.
2014-12-18 11:54:52 -07:00
Josh Matthews
5ca61c00b9 Add a ton of properties and improve a bunch of serialization. 2014-12-18 12:54:02 -05:00
Tetsuharu OHZEKI
135ee60f5a style: Remove glob imports added in #4405 2014-12-19 01:49:24 +09:00
Ms2ger
466faac2a5 Update rustc to revision 3dcd2157403163789aaf21a9ab3c4d30a7c6494d. 2014-12-17 15:19:45 -05:00
Matthew Rasmus
fc0748f50e Makes layout respect <textarea> rows attribute
review addresssing
2014-12-16 11:02:01 -08:00
Matthew Rasmus
2c7f6076d1 Makes layout respect <textarea> cols attribute 2014-12-16 10:44:15 -08:00
Patrick Walton
a1ea44b294 style: Address review comments relating to bgcolor and column spans 2014-12-15 18:09:44 -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
e0e14c60d6 style: Move presentational hint synthesis into legacy.rs. 2014-12-15 17:41:25 -08:00
Patrick Walton
5f8d3f72d8 layout: Introduce support for legacy presentational attributes to selector
matching, and use it for `<input size>` and `<td width>`.

This implements a general framework for legacy presentational attributes
to the DOM and style calculation, so that adding more of them later will
be straightforward.
2014-10-14 12:44:09 -07:00