| 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 3052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3063 } | 3063 } |
| 3064 | 3064 |
| 3065 void RenderObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
n& underline, AppliedTextDecoration& overline, AppliedTextDecoration& linethroug
h, bool quirksMode, bool firstlineStyle) | 3065 void RenderObject::getTextDecorations(unsigned decorations, AppliedTextDecoratio
n& underline, AppliedTextDecoration& overline, AppliedTextDecoration& linethroug
h, bool quirksMode, bool firstlineStyle) |
| 3066 { | 3066 { |
| 3067 RenderObject* curr = this; | 3067 RenderObject* curr = this; |
| 3068 RenderStyle* styleToUse = 0; | 3068 RenderStyle* styleToUse = 0; |
| 3069 unsigned currDecs = TextDecorationNone; | 3069 unsigned currDecs = TextDecorationNone; |
| 3070 Color resultColor; | 3070 Color resultColor; |
| 3071 TextDecorationStyle resultStyle; | 3071 TextDecorationStyle resultStyle; |
| 3072 do { | 3072 do { |
| 3073 styleToUse = curr->style(firstlineStyle); | 3073 styleToUse = curr->style(firstlineStyle ? FirstLineStyle : OwnStyle); |
| 3074 currDecs = styleToUse->textDecoration(); | 3074 currDecs = styleToUse->textDecoration(); |
| 3075 currDecs &= decorations; | 3075 currDecs &= decorations; |
| 3076 resultColor = styleToUse->visitedDependentDecorationColor(); | 3076 resultColor = styleToUse->visitedDependentDecorationColor(); |
| 3077 resultStyle = styleToUse->textDecorationStyle(); | 3077 resultStyle = styleToUse->textDecorationStyle(); |
| 3078 // Parameter 'decorations' is cast as an int to enable the bitwise opera
tions below. | 3078 // Parameter 'decorations' is cast as an int to enable the bitwise opera
tions below. |
| 3079 if (currDecs) { | 3079 if (currDecs) { |
| 3080 if (currDecs & TextDecorationUnderline) { | 3080 if (currDecs & TextDecorationUnderline) { |
| 3081 decorations &= ~TextDecorationUnderline; | 3081 decorations &= ~TextDecorationUnderline; |
| 3082 underline.color = resultColor; | 3082 underline.color = resultColor; |
| 3083 underline.style = resultStyle; | 3083 underline.style = resultStyle; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 3095 } | 3095 } |
| 3096 if (curr->isRubyText()) | 3096 if (curr->isRubyText()) |
| 3097 return; | 3097 return; |
| 3098 curr = curr->parent(); | 3098 curr = curr->parent(); |
| 3099 if (curr && curr->isAnonymousBlock() && toRenderBlock(curr)->continuatio
n()) | 3099 if (curr && curr->isAnonymousBlock() && toRenderBlock(curr)->continuatio
n()) |
| 3100 curr = toRenderBlock(curr)->continuation(); | 3100 curr = toRenderBlock(curr)->continuation(); |
| 3101 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc
horElement(*curr->node()) && !isHTMLFontElement(*curr->node())))); | 3101 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc
horElement(*curr->node()) && !isHTMLFontElement(*curr->node())))); |
| 3102 | 3102 |
| 3103 // If we bailed out, use the element we bailed out at (typically a <font> or
<a> element). | 3103 // If we bailed out, use the element we bailed out at (typically a <font> or
<a> element). |
| 3104 if (decorations && curr) { | 3104 if (decorations && curr) { |
| 3105 styleToUse = curr->style(firstlineStyle); | 3105 styleToUse = curr->style(firstlineStyle ? FirstLineStyle : OwnStyle); |
| 3106 resultColor = styleToUse->visitedDependentDecorationColor(); | 3106 resultColor = styleToUse->visitedDependentDecorationColor(); |
| 3107 if (decorations & TextDecorationUnderline) { | 3107 if (decorations & TextDecorationUnderline) { |
| 3108 underline.color = resultColor; | 3108 underline.color = resultColor; |
| 3109 underline.style = resultStyle; | 3109 underline.style = resultStyle; |
| 3110 } | 3110 } |
| 3111 if (decorations & TextDecorationOverline) { | 3111 if (decorations & TextDecorationOverline) { |
| 3112 overline.color = resultColor; | 3112 overline.color = resultColor; |
| 3113 overline.style = resultStyle; | 3113 overline.style = resultStyle; |
| 3114 } | 3114 } |
| 3115 if (decorations & TextDecorationLineThrough) { | 3115 if (decorations & TextDecorationLineThrough) { |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3447 { | 3447 { |
| 3448 if (object1) { | 3448 if (object1) { |
| 3449 const WebCore::RenderObject* root = object1; | 3449 const WebCore::RenderObject* root = object1; |
| 3450 while (root->parent()) | 3450 while (root->parent()) |
| 3451 root = root->parent(); | 3451 root = root->parent(); |
| 3452 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3452 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3453 } | 3453 } |
| 3454 } | 3454 } |
| 3455 | 3455 |
| 3456 #endif | 3456 #endif |
| OLD | NEW |