Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert layout code to use logical directions #2797

Closed
wants to merge 4 commits into from

Conversation

@SimonSapin
Copy link
Member

SimonSapin commented Jul 9, 2014

Going towards CSS Writing Modes support, this converts the layout code to use flow-relative (logical) directions. There is two parts to this:

  • Renaming all the things, largely with sed. Top, bottom, left, right, width, and height become bstart, bend, istart, iend, isize, and bsize. "i" and "b" are short for inline-direction and block-direction.
  • Using the logical-space geometry primitives from #2790. This often requires knowing the current writing mode. There is therefore new writing_mode fields on ComputedValues, BaseFlow, and Floats structs. (See also #2795.)

There certainly a lot of bugs (including runtime failures) with vertical or mixed-writing modes documents, but there should be no regression in horizontal LTR documents.

The first commit also adds a -e / --experimental command-line flag, and disables parsing of the direction, writing-mode and text-orientation properties. This makes sure that everything is in horizontal LTR when the flag is not set.

r? @pcwalton

@highfive
Copy link

highfive commented Jul 9, 2014

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
SimonSapin added 2 commits Jul 9, 2014
Also mark as expected failure a reftest that uses 'direction'.

That property is behind the new --experimental flag,
but enabling the flag fails at runtime.
@SimonSapin SimonSapin closed this Jul 11, 2014
@SimonSapin SimonSapin reopened this Jul 11, 2014
@hoppipolla-critic-bot
Copy link

hoppipolla-critic-bot commented Jul 11, 2014

Critic review: https://critic.hoppipolla.co.uk/r/2014

This is an external review system which you may optionally use for the code review of your pull request.

In order to help critic track your changes, please do not make in-place history rewrites (e.g. via git rebase -i or git commit --amend) when updating this pull request.

@pcwalton
Copy link
Contributor

pcwalton commented Jul 17, 2014

Reviewed on Critic.

@SimonSapin
Copy link
Member Author

SimonSapin commented Jul 18, 2014

Landed in #2869.

@SimonSapin SimonSapin closed this Jul 18, 2014
@SimonSapin SimonSapin deleted the SimonSapin:writing-modes branch Jul 18, 2014
sgmenda pushed a commit to sgmenda/servo that referenced this pull request Aug 3, 2015
…linear_gradients_smoke_a.html linear_gradients_smoke_ref.html 189 == linebreak_inline_span_a.html linebreak_inline_span_b.html 190 flaky_cpu == linebreak_simple_a.html linebreak_simple_b.html 191 # Fails intermittently (servo#3636) 192 # == link_style_dynamic_addition.html link_style_dynamic_addition_ref.html 193 == link_style_order.html link_style_order_ref.html 194 == list_style_image_sizing_a.html list_style_image_sizing_ref.html 195 == list_style_position_a.html list_style_position_ref.html 196 != list_style_type_a.html list_style_type_ref.html 197 == many_brs_a.html many_brs_ref.html 198 == margin_a.html margin_b.html 199 == margins_inside_floats_a.html margins_inside_floats_ref.html 200 == max_width_float_simple_a.html max_width_float_simple_b.html 201 == max_width_simple_a.html max_width_simple_b.html 202 == min_max_height_a.html min_max_height_b.html 203 == min_width_float_simple_a.html min_width_float_simple_b.html 204 == min_width_simple_a.html min_width_simple_b.html 205 == minimum_line_height_a.html minimum_line_height_b.html 206 == mix_blend_mode_a.html mix_blend_mode_ref.html 207 == multiple_css_class_a.html multiple_css_class_b.html 208 == negative_margin_uncle_a.html negative_margin_uncle_b.html 209 == negative_margins_a.html negative_margins_b.html 210 == no-image.html no-image-ref.html 211 == no_image_background_a.html no_image_background_ref.html 212 == noscript.html noscript_ref.html 213 != noteq_attr_exists_selector.html attr_exists_selector_ref.html 214 == nth_child_pseudo_a.html nth_child_pseudo_b.html 215 == nth_last_child_pseudo_a.html nth_last_child_pseudo_b.html 216 == nth_last_of_type_pseudo_a.html nth_last_of_type_pseudo_b.html 217 == nth_of_type_pseudo_a.html nth_of_type_pseudo_b.html 218 == object_element_a.html object_element_b.html 219 == ol_japanese_iroha_a.html ol_japanese_iroha_ref.html 220 != ol_japanese_iroha_bullet_styles.html ol_japanese_iroha_ref.html 221 == ol_simple_a.html ol_simple_ref.html 222 == only_child_pseudo_a.html only_child_pseudo_b.html 223 == only_of_type_pseudo_a.html only_of_type_pseudo_b.html 224 == opacity_simple_a.html opacity_simple_ref.html 225 == opacity_stacking_context_a.html opacity_stacking_context_ref.html 226 == outline_offset_a.html outline_offset_ref.html 227 == outlines_simple_a.html outlines_simple_ref.html 228 == outlines_wrap_a.html outlines_wrap_ref.html 229 == outset.html outset_ref.html 230 != outset_blackborder.html blackborder_ref.html 231 # Should be == with expected failure. See servo#2797 232 != overconstrained_block.html overconstrained_block_ref.html 233 == overflow_auto.html overflow_simple_b.html 234 == overflow_scroll.html overflow_simple_b.html 235 == overflow_simple_a.html overflow_simple_b.html 236 == overflow_wrap_a.html overflow_wrap_ref.html 237 == overflow_xy_a.html overflow_xy_ref.html 238 == per_glyph_font_fallback_a.html per_glyph_font_fallback_ref.html 239 == percent_height.html percent_height_ref.html 240 == percentage_height_float_a.html percentage_height_float_ref.html 241 == percentage_height_root.html percentage_height_root_ref.html 242 == percentage_width_inline_block_a.html percentage_width_inline_block_ref.html 243 == png_rgba_colorspace_a.html png_rgba_colorspace_b.html 244 == position_abs_cb_with_non_cb_kid_a.html position_abs_cb_with_non_cb_kid_b.html 245 == position_abs_height_width_a.html position_abs_height_width_b.html 246 == position_abs_left_a.html position_abs_left_b.html 247 == position_abs_margin_top_percentage_a.html position_abs_margin_top_percentage_b.html 248 == position_abs_nested_a.html position_abs_nested_b.html 249 == position_abs_pseudo_a.html position_abs_pseudo_b.html 250 == position_abs_replaced_simple_a.html position_abs_replaced_simple_b.html 251 == position_abs_static_y_a.html position_abs_static_y_b.html 252 == position_abs_width_percentage_a.html position_abs_width_percentage_b.html 253 # commented out because multiple layers don't work with reftests --pcwalton 254 # == position_fixed_a.html position_fixed_b.html 255 == position_fixed_background_color_a.html position_fixed_background_color_b.html 256 == position_fixed_overflow_a.html position_fixed_overflow_b.html 257 # == position_fixed_simple_a.html position_fixed_simple
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.