Source/WebCore/ChangeLog

 12012-07-30 Bruno de Oliveira Abinader <bruno.abinader@basyskom.com>
 2
 3 [css] Prefer usage of RenderStyle::textDecorationsInEffect() when rendering
 4 https://bugs.webkit.org/show_bug.cgi?id=92659
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 WebKit currently has a proprietary CSS property
 9 '-webkit-text-decorations-in-effect', which as far as I've studied on the code
 10 and tested, is only used internally as part of the 'text-decoration' CSS
 11 property implementation (as up to CSS spec 2.1). Inside WebCore/rendering, there
 12 are mixed usage of both RenderStyle::textDecoration() and
 13 RenderStyle::textDecorationsInEffect(). To avoid a possible breach in terms of
 14 data redundancy, prefer usage of RenderStyle::textDecorationsInEffect() sounds
 15 more correct, after render style adjustments.
 16
 17 * accessibility/gtk/WebKitAccessibleInterfaceText.cpp:
 18 (getAttributeSetForAccessibilityObject):
 19 * rendering/RenderObject.cpp:
 20 (WebCore::RenderObject::getTextDecorationColors):
 21 * rendering/svg/SVGInlineTextBox.cpp:
 22 (WebCore::findRenderObjectDefininingTextDecoration):
 23 (WebCore::SVGInlineTextBox::paintDecoration):
 24
1252012-07-27 Sheriff Bot <webkit.review.bot@gmail.com>
226
327 Unreviewed, rolling out r123908.

Source/WebCore/accessibility/gtk/WebKitAccessibleInterfaceText.cpp

@@static AtkAttributeSet* getAttributeSetForAccessibilityObject(const Accessibilit
305305 result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_JUSTIFICATION), "fill");
306306 }
307307
308  result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_UNDERLINE), (style->textDecoration() & UNDERLINE) ? "single" : "none");
 308 result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_UNDERLINE), (style->textDecorationsInEffect() & UNDERLINE) ? "single" : "none");
309309
310310 result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_STYLE), style->font().italic() ? "italic" : "normal");
311311
312  result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_STRIKETHROUGH), (style->textDecoration() & LINE_THROUGH) ? "true" : "false");
 312 result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_STRIKETHROUGH), (style->textDecorationsInEffect() & LINE_THROUGH) ? "true" : "false");
313313
314314 result = addToAtkAttributeSet(result, atk_text_attribute_get_name(ATK_TEXT_ATTR_INVISIBLE), (style->visibility() == HIDDEN) ? "true" : "false");
315315

Source/WebCore/rendering/RenderObject.cpp

@@void RenderObject::getTextDecorationColors(int decorations, Color& underline, Co
25972597 RenderStyle* styleToUse = 0;
25982598 do {
25992599 styleToUse = curr->style(firstlineStyle);
2600  int currDecs = styleToUse->textDecoration();
 2600 int currDecs = styleToUse->textDecorationsInEffect();
26012601 if (currDecs) {
26022602 if (currDecs & UNDERLINE) {
26032603 decorations &= ~UNDERLINE;

Source/WebCore/rendering/svg/SVGInlineTextBox.cpp

@@static inline RenderObject* findRenderObjectDefininingTextDecoration(InlineFlowB
507507 while (parentBox) {
508508 renderer = parentBox->renderer();
509509
510  if (renderer->style() && renderer->style()->textDecoration() != TDNONE)
 510 if (renderer->style() && renderer->style()->textDecorationsInEffect() != TDNONE)
511511 break;
512512
513513 parentBox = parentBox->parent();

@@static inline RenderObject* findRenderObjectDefininingTextDecoration(InlineFlowB
519519
520520void SVGInlineTextBox::paintDecoration(GraphicsContext* context, ETextDecoration decoration, const SVGTextFragment& fragment)
521521{
522  if (textRenderer()->style()->textDecorationsInEffect() == TDNONE)
 522 if (textRenderer()->style() && textRenderer()->style()->textDecorationsInEffect() == TDNONE)
523523 return;
524524
525525 // Find out which render style defined the text-decoration, as its fill/stroke properties have to be used for drawing instead of ours.