Skip to content

Commit

Permalink
Bug 1084183 - Propagate text decoration to ruby frames. r=dbaron
Browse files Browse the repository at this point in the history
  • Loading branch information
upsuper committed Nov 16, 2014
1 parent cd03927 commit 06a84fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions layout/generic/nsTextFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4871,8 +4871,12 @@ nsTextFrame::GetTextDecorations(

// In all modes, if we're on an inline-block or inline-table (or
// inline-stack, inline-box, inline-grid), we're done.
// If we're on a ruby frame other than ruby text container, we
// should continue.
uint8_t display = f->GetDisplay();
if (display != NS_STYLE_DISPLAY_INLINE &&
(!nsStyleDisplay::IsRubyDisplayType(display) ||
display == NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER) &&
nsStyleDisplay::IsDisplayTypeInlineOutside(display)) {
break;
}
Expand Down
14 changes: 9 additions & 5 deletions layout/style/nsStyleStruct.h
Original file line number Diff line number Diff line change
Expand Up @@ -2137,12 +2137,16 @@ struct nsStyleDisplay {
NS_STYLE_POSITION_STICKY == mPosition;
}

static bool IsRubyDisplayType(uint8_t aDisplay) {
return NS_STYLE_DISPLAY_RUBY == aDisplay ||
NS_STYLE_DISPLAY_RUBY_BASE == aDisplay ||
NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER == aDisplay ||
NS_STYLE_DISPLAY_RUBY_TEXT == aDisplay ||
NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER == aDisplay;
}

bool IsRubyDisplayType() const {
return NS_STYLE_DISPLAY_RUBY == mDisplay ||
NS_STYLE_DISPLAY_RUBY_BASE == mDisplay ||
NS_STYLE_DISPLAY_RUBY_BASE_CONTAINER == mDisplay ||
NS_STYLE_DISPLAY_RUBY_TEXT == mDisplay ||
NS_STYLE_DISPLAY_RUBY_TEXT_CONTAINER == mDisplay;
return IsRubyDisplayType(mDisplay);
}

bool IsFlexOrGridDisplayType() const {
Expand Down

0 comments on commit 06a84fb

Please sign in to comment.