| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) | 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv
ed. |
| 7 * Copyright (C) 2009 Google Inc. All rights reserved. | 7 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 3122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3133 } | 3133 } |
| 3134 | 3134 |
| 3135 void RenderObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
n& underline, AppliedTextDecoration& overline, AppliedTextDecoration& linethroug
h, bool quirksMode, bool firstlineStyle) | 3135 void RenderObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
n& underline, AppliedTextDecoration& overline, AppliedTextDecoration& linethroug
h, bool quirksMode, bool firstlineStyle) |
| 3136 { | 3136 { |
| 3137 RenderObject* curr = this; | 3137 RenderObject* curr = this; |
| 3138 RenderStyle* styleToUse = 0; | 3138 RenderStyle* styleToUse = 0; |
| 3139 unsigned currDecs = TextDecorationNone; | 3139 unsigned currDecs = TextDecorationNone; |
| 3140 Color resultColor; | 3140 Color resultColor; |
| 3141 TextDecorationStyle resultStyle; | 3141 TextDecorationStyle resultStyle; |
| 3142 do { | 3142 do { |
| 3143 styleToUse = curr->style(firstlineStyle); | 3143 styleToUse = curr->styleOrFirstLineStyle(firstlineStyle); |
| 3144 currDecs = styleToUse->textDecoration(); | 3144 currDecs = styleToUse->textDecoration(); |
| 3145 currDecs &= decorations; | 3145 currDecs &= decorations; |
| 3146 resultColor = styleToUse->visitedDependentDecorationColor(); | 3146 resultColor = styleToUse->visitedDependentDecorationColor(); |
| 3147 resultStyle = styleToUse->textDecorationStyle(); | 3147 resultStyle = styleToUse->textDecorationStyle(); |
| 3148 // Parameter 'decorations' is cast as an int to enable the bitwise opera
tions below. | 3148 // Parameter 'decorations' is cast as an int to enable the bitwise opera
tions below. |
| 3149 if (currDecs) { | 3149 if (currDecs) { |
| 3150 if (currDecs & TextDecorationUnderline) { | 3150 if (currDecs & TextDecorationUnderline) { |
| 3151 decorations &= ~TextDecorationUnderline; | 3151 decorations &= ~TextDecorationUnderline; |
| 3152 underline.color = resultColor; | 3152 underline.color = resultColor; |
| 3153 underline.style = resultStyle; | 3153 underline.style = resultStyle; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3165 } | 3165 } |
| 3166 if (curr->isRubyText()) | 3166 if (curr->isRubyText()) |
| 3167 return; | 3167 return; |
| 3168 curr = curr->parent(); | 3168 curr = curr->parent(); |
| 3169 if (curr && curr->isAnonymousBlock() && toRenderBlock(curr)->continuatio
n()) | 3169 if (curr && curr->isAnonymousBlock() && toRenderBlock(curr)->continuatio
n()) |
| 3170 curr = toRenderBlock(curr)->continuation(); | 3170 curr = toRenderBlock(curr)->continuation(); |
| 3171 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc
horElement(*curr->node()) && !isHTMLFontElement(*curr->node())))); | 3171 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc
horElement(*curr->node()) && !isHTMLFontElement(*curr->node())))); |
| 3172 | 3172 |
| 3173 // If we bailed out, use the element we bailed out at (typically a <font> or
<a> element). | 3173 // If we bailed out, use the element we bailed out at (typically a <font> or
<a> element). |
| 3174 if (decorations && curr) { | 3174 if (decorations && curr) { |
| 3175 styleToUse = curr->style(firstlineStyle); | 3175 styleToUse = curr->styleOrFirstLineStyle(firstlineStyle); |
| 3176 resultColor = styleToUse->visitedDependentDecorationColor(); | 3176 resultColor = styleToUse->visitedDependentDecorationColor(); |
| 3177 if (decorations & TextDecorationUnderline) { | 3177 if (decorations & TextDecorationUnderline) { |
| 3178 underline.color = resultColor; | 3178 underline.color = resultColor; |
| 3179 underline.style = resultStyle; | 3179 underline.style = resultStyle; |
| 3180 } | 3180 } |
| 3181 if (decorations & TextDecorationOverline) { | 3181 if (decorations & TextDecorationOverline) { |
| 3182 overline.color = resultColor; | 3182 overline.color = resultColor; |
| 3183 overline.style = resultStyle; | 3183 overline.style = resultStyle; |
| 3184 } | 3184 } |
| 3185 if (decorations & TextDecorationLineThrough) { | 3185 if (decorations & TextDecorationLineThrough) { |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3516 { | 3516 { |
| 3517 if (object1) { | 3517 if (object1) { |
| 3518 const WebCore::RenderObject* root = object1; | 3518 const WebCore::RenderObject* root = object1; |
| 3519 while (root->parent()) | 3519 while (root->parent()) |
| 3520 root = root->parent(); | 3520 root = root->parent(); |
| 3521 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3521 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3522 } | 3522 } |
| 3523 } | 3523 } |
| 3524 | 3524 |
| 3525 #endif | 3525 #endif |
| OLD | NEW |