Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up'text-align' of inline flow should be determined by containing block's style #222
Comments
dhedlund
added a commit
to dhedlund/servo
that referenced
this issue
Dec 7, 2013
dhedlund
added a commit
to dhedlund/servo
that referenced
this issue
Dec 7, 2013
dhedlund
added a commit
to dhedlund/servo
that referenced
this issue
Dec 9, 2013
bors-servo
pushed a commit
that referenced
this issue
Dec 13, 2013
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?
therealglazou
added a commit
to therealglazou/servo
that referenced
this issue
Feb 20, 2014
glennw
pushed a commit
to glennw/servo
that referenced
this issue
Jan 16, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, we just look at the style of the first block of each line to determine that line's text alignment.