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

stylo: Set the NS_STYLE_IS_TEXT_COMBINED flag. #17819

Merged
merged 1 commit into from Jul 22, 2017
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

stylo: Set the NS_STYLE_IS_TEXT_COMBINED flag.

This should fix at least
layout/reftests/writing-mode/1135361-ruby-justify-1.html
  • Loading branch information
emilio committed Jul 22, 2017
commit b576229567041dc9ea8f882d92cf0faaf423308b
@@ -28,5 +28,10 @@ bitflags! {
/// This bit is propagated to all children of line participants.
/// It is currently used by ruby to make its content unbreakable.
const SHOULD_SUPPRESS_LINEBREAK = 1 << 1,

/// A flag used to mark text that that has text-combine-upright.
///
/// This is used from Gecko's layout engine.
const IS_TEXT_COMBINED = 1 << 2,
}
}
@@ -107,6 +107,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
fn adjust_for_text_combine_upright(&mut self) {
use computed_values::text_combine_upright::T as text_combine_upright;
use computed_values::writing_mode::T as writing_mode;
use properties::computed_value_flags::IS_TEXT_COMBINED;

let writing_mode =
self.style.get_inheritedbox().clone_writing_mode();
@@ -115,6 +116,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {

if writing_mode != writing_mode::horizontal_tb &&
text_combine_upright == text_combine_upright::all {
self.style.flags.insert(IS_TEXT_COMBINED);
self.style.mutate_inheritedbox().set_writing_mode(writing_mode::horizontal_tb);
}
}
@@ -409,6 +411,7 @@ impl<'a, 'b: 'a> StyleAdjuster<'a, 'b> {
self.style.reset_border_struct();
self.style.reset_padding_struct();
}

// Force bidi isolation on all internal ruby boxes and ruby container
// per spec https://drafts.csswg.org/css-ruby-1/#bidi
if self_display.is_ruby_type() {
@@ -1742,6 +1742,9 @@ pub extern "C" fn Servo_ComputedValues_GetStyleBits(values: ServoStyleContextBor
if flags.contains(SHOULD_SUPPRESS_LINEBREAK) {
result |= structs::NS_STYLE_SUPPRESS_LINEBREAK as u64;
}
if flags.contains(IS_TEXT_COMBINED) {
result |= structs::NS_STYLE_IS_TEXT_COMBINED as u64;
}
result
}

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.