Changeset 116373 in webkit
- Timestamp:
- May 7, 2012 4:39:40 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r116370 r116373 1 2012-05-07 Pravin D <pravind.2k4@gmail.com> 2 3 :first-line text-decorations are not rendered 4 https://bugs.webkit.org/show_bug.cgi?id=6047 5 6 Reviewed by Eric Seidel. 7 8 * fast/css/first-line-text-decoration.html: Added. 9 * platform/qt-linux/fast/css/first-line-text-decoration-expected.png: Added. 10 * platform/qt-linux/fast/css/first-line-text-decoration-expected.txt: Added. 11 This test checks if text-decoration present in the tags first-line style is applied properly. 12 13 * fast/css/first-line-text-decoration-inherited-from-parent.html: Added. 14 * platform/qt-linux/fast/css/first-line-text-decoration-inherited-from-parent-expected.png: Added. 15 * platform/qt-linux/fast/css/first-line-text-decoration-inherited-from-parent-expected.txt: Added. 16 This test checks if the text-decoration and text color is chosen properly in the case where 17 the first-line style is inherited from a parent and contains such text-decorations. 18 1 19 2012-05-07 Philippe Normand <pnormand@igalia.com> 2 20 -
trunk/Source/WebCore/ChangeLog
r116371 r116373 1 2012-05-07 Pravin D <pravind.2k4@gmail.com> 2 3 :first-line text-decorations are not rendered 4 https://bugs.webkit.org/show_bug.cgi?id=6047 5 6 Text-decorations are applied during paint phase. The style was not being properly selected in case of 7 first line box. The patch fixes this. 8 9 Reviewed by Eric Seidel. 10 11 Tests: fast/css/first-line-text-decoration-inherited-from-parent.html 12 fast/css/first-line-text-decoration.html 13 14 * rendering/InlineTextBox.cpp: 15 (WebCore::InlineTextBox::paintDecoration): 16 Inform the decoration color retriever if this box is part of the first line box or not. 17 18 * rendering/RenderObject.cpp: 19 (WebCore::decorationColor): 20 Changed the argument from RenderObject* to RenderStyle*. As this function is just a helper to getTextDecorationColors 21 as used RenderObject solely to retrieve the corresponding RenderStyle, which(RenderStyle*) was already available with the latter function. 22 23 (WebCore::RenderObject::getTextDecorationColors): 24 Take a new variable to check if first line style or the regular style has to be used. 25 Sends RenderStyle* as an argument to decorationColor(). 26 27 * rendering/RenderObject.h: 28 (RenderObject): 29 1 30 2012-05-07 Julien Chaffraix <jchaffraix@webkit.org> 2 31 -
trunk/Source/WebCore/rendering/InlineTextBox.cpp
r116353 r116373 916 916 // Get the text decoration colors. 917 917 Color underline, overline, linethrough; 918 renderer()->getTextDecorationColors(deco, underline, overline, linethrough, true );918 renderer()->getTextDecorationColors(deco, underline, overline, linethrough, true, isFirstLineStyle()); 919 919 920 920 // Use a special function for underlines to get the positioning exactly right. -
trunk/Source/WebCore/rendering/RenderObject.cpp
r116339 r116373 2572 2572 } 2573 2573 2574 static Color decorationColor(Render Object* renderer)2574 static Color decorationColor(RenderStyle* style) 2575 2575 { 2576 2576 Color result; 2577 if ( renderer->style()->textStrokeWidth() > 0) {2577 if (style->textStrokeWidth() > 0) { 2578 2578 // Prefer stroke color if possible but not if it's fully transparent. 2579 result = renderer->style()->visitedDependentColor(CSSPropertyWebkitTextStrokeColor);2579 result = style->visitedDependentColor(CSSPropertyWebkitTextStrokeColor); 2580 2580 if (result.alpha()) 2581 2581 return result; 2582 2582 } 2583 2583 2584 result = renderer->style()->visitedDependentColor(CSSPropertyWebkitTextFillColor);2584 result = style->visitedDependentColor(CSSPropertyWebkitTextFillColor); 2585 2585 return result; 2586 2586 } 2587 2587 2588 2588 void RenderObject::getTextDecorationColors(int decorations, Color& underline, Color& overline, 2589 Color& linethrough, bool quirksMode )2589 Color& linethrough, bool quirksMode, bool firstlineStyle) 2590 2590 { 2591 2591 RenderObject* curr = this; 2592 RenderStyle* styleToUse = 0; 2592 2593 do { 2593 int currDecs = curr->style()->textDecoration(); 2594 styleToUse = curr->style(firstlineStyle); 2595 int currDecs = styleToUse->textDecoration(); 2594 2596 if (currDecs) { 2595 2597 if (currDecs & UNDERLINE) { 2596 2598 decorations &= ~UNDERLINE; 2597 underline = decorationColor( curr);2599 underline = decorationColor(styleToUse); 2598 2600 } 2599 2601 if (currDecs & OVERLINE) { 2600 2602 decorations &= ~OVERLINE; 2601 overline = decorationColor( curr);2603 overline = decorationColor(styleToUse); 2602 2604 } 2603 2605 if (currDecs & LINE_THROUGH) { 2604 2606 decorations &= ~LINE_THROUGH; 2605 linethrough = decorationColor( curr);2607 linethrough = decorationColor(styleToUse); 2606 2608 } 2607 2609 } … … 2616 2618 // If we bailed out, use the element we bailed out at (typically a <font> or <a> element). 2617 2619 if (decorations && curr) { 2620 styleToUse = curr->style(firstlineStyle); 2618 2621 if (decorations & UNDERLINE) 2619 underline = decorationColor( curr);2622 underline = decorationColor(styleToUse); 2620 2623 if (decorations & OVERLINE) 2621 overline = decorationColor( curr);2624 overline = decorationColor(styleToUse); 2622 2625 if (decorations & LINE_THROUGH) 2623 linethrough = decorationColor( curr);2626 linethrough = decorationColor(styleToUse); 2624 2627 } 2625 2628 } -
trunk/Source/WebCore/rendering/RenderObject.h
r116238 r116373 714 714 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const; 715 715 716 void getTextDecorationColors(int decorations, Color& underline, Color& overline, Color& linethrough, bool quirksMode = false );716 void getTextDecorationColors(int decorations, Color& underline, Color& overline, Color& linethrough, bool quirksMode = false, bool firstlineStyle = false); 717 717 718 718 // Return the RenderBox in the container chain which is responsible for painting this object, or 0
Note: See TracChangeset
for help on using the changeset viewer.