diff options
author | bors-servo <release+servo@mozilla.com> | 2013-12-13 09:07:11 -0800 |
---|---|---|
committer | bors-servo <release+servo@mozilla.com> | 2013-12-13 09:07:11 -0800 |
commit | c67669fe738ea377c221fa41cb3f84a60ad634e3 (patch) | |
tree | 37649bf1305e8f8d3f023f5e8b6725f0693c3f1d /src/components/msg/compositor_msg.rs | |
parent | 2ecafee5a56dee7920802feebdf321c19a228613 (diff) | |
parent | 555e04475e14b8a72b3e4f1c87fecb7d522b8a33 (diff) | |
download | servo-c67669fe738ea377c221fa41cb3f84a60ad634e3.tar.gz servo-c67669fe738ea377c221fa41cb3f84a60ad634e3.zip |
auto merge of #1349 : dhedlund/servo/issue_222, r=jdm,me
Fixes #222.
Implements 'text-align' inheritance for inline elements. The text alignment code has been changed a couple of times since the ticket was originally opened and was improved to inherit the text-align property from from an ancestor element. This addressed the issue, so long as no inline elements had a text-align property defined. Both Firefox and Chromium ignore any text-align properties attached to inline elements, but none of the specs are explicit about ignoring the property or inheriting only from non-inline elements:
http://www.w3.org/TR/CSS2/visuren.html#inline-formatting
http://www.w3.org/TR/CSS2/text.html#propdef-text-align
This is my first stab at writing any code that touches the DOM node tree. Based on a few observations, I made the assumption that the `self.base.node` of a InlineFlow always corresponds to a BlockFlow-based node, no matter how deep inline DOM elements are nested; there was no obvious way to traverse Flow-traited objects directly and I'm not sure if it's possible to get from a FlowData struct back to a non-child {Block,Inline}Flow (probably intentionally).
I could've kept traversing the node tree directly, checking against each node style to ensure it didn't have an inline display property, but I could not create a scenario where the `base.node` was ever an inline. It also feels like a code smell to be walking up the tree at all, especially for stylesheet properties. Feels like it should eventually be handled in style::properties directly as being conditional inherited?
Diffstat (limited to 'src/components/msg/compositor_msg.rs')
0 files changed, 0 insertions, 0 deletions