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 2700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2711 { | 2711 { |
2712 RenderObject* curr = this; | 2712 RenderObject* curr = this; |
2713 RenderStyle* styleToUse = 0; | 2713 RenderStyle* styleToUse = 0; |
2714 unsigned currDecs = TextDecorationNone; | 2714 unsigned currDecs = TextDecorationNone; |
2715 Color resultColor; | 2715 Color resultColor; |
2716 TextDecorationStyle resultStyle; | 2716 TextDecorationStyle resultStyle; |
2717 do { | 2717 do { |
2718 styleToUse = curr->style(firstlineStyle); | 2718 styleToUse = curr->style(firstlineStyle); |
2719 currDecs = styleToUse->textDecoration(); | 2719 currDecs = styleToUse->textDecoration(); |
2720 currDecs &= decorations; | 2720 currDecs &= decorations; |
2721 resultColor = styleToUse->visitedDependentDecorationColor(); | 2721 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio
nColor); |
2722 resultStyle = styleToUse->textDecorationStyle(); | 2722 resultStyle = styleToUse->textDecorationStyle(); |
2723 // Parameter 'decorations' is cast as an int to enable the bitwise opera
tions below. | 2723 // Parameter 'decorations' is cast as an int to enable the bitwise opera
tions below. |
2724 if (currDecs) { | 2724 if (currDecs) { |
2725 if (currDecs & TextDecorationUnderline) { | 2725 if (currDecs & TextDecorationUnderline) { |
2726 decorations &= ~TextDecorationUnderline; | 2726 decorations &= ~TextDecorationUnderline; |
2727 underline.color = resultColor; | 2727 underline.color = resultColor; |
2728 underline.style = resultStyle; | 2728 underline.style = resultStyle; |
2729 } | 2729 } |
2730 if (currDecs & TextDecorationOverline) { | 2730 if (currDecs & TextDecorationOverline) { |
2731 decorations &= ~TextDecorationOverline; | 2731 decorations &= ~TextDecorationOverline; |
2732 overline.color = resultColor; | 2732 overline.color = resultColor; |
2733 overline.style = resultStyle; | 2733 overline.style = resultStyle; |
2734 } | 2734 } |
2735 if (currDecs & TextDecorationLineThrough) { | 2735 if (currDecs & TextDecorationLineThrough) { |
2736 decorations &= ~TextDecorationLineThrough; | 2736 decorations &= ~TextDecorationLineThrough; |
2737 linethrough.color = resultColor; | 2737 linethrough.color = resultColor; |
2738 linethrough.style = resultStyle; | 2738 linethrough.style = resultStyle; |
2739 } | 2739 } |
2740 } | 2740 } |
2741 if (curr->isRubyText()) | 2741 if (curr->isRubyText()) |
2742 return; | 2742 return; |
2743 curr = curr->parent(); | 2743 curr = curr->parent(); |
2744 if (curr && curr->isAnonymousBlock() && toRenderBlock(curr)->continuatio
n()) | 2744 if (curr && curr->isAnonymousBlock() && toRenderBlock(curr)->continuatio
n()) |
2745 curr = toRenderBlock(curr)->continuation(); | 2745 curr = toRenderBlock(curr)->continuation(); |
2746 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc
horElement(*curr->node()) && !isHTMLFontElement(*curr->node())))); | 2746 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc
horElement(*curr->node()) && !isHTMLFontElement(*curr->node())))); |
2747 | 2747 |
2748 // If we bailed out, use the element we bailed out at (typically a <font> or
<a> element). | 2748 // If we bailed out, use the element we bailed out at (typically a <font> or
<a> element). |
2749 if (decorations && curr) { | 2749 if (decorations && curr) { |
2750 styleToUse = curr->style(firstlineStyle); | 2750 styleToUse = curr->style(firstlineStyle); |
2751 resultColor = styleToUse->visitedDependentDecorationColor(); | 2751 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio
nColor); |
2752 if (decorations & TextDecorationUnderline) { | 2752 if (decorations & TextDecorationUnderline) { |
2753 underline.color = resultColor; | 2753 underline.color = resultColor; |
2754 underline.style = resultStyle; | 2754 underline.style = resultStyle; |
2755 } | 2755 } |
2756 if (decorations & TextDecorationOverline) { | 2756 if (decorations & TextDecorationOverline) { |
2757 overline.color = resultColor; | 2757 overline.color = resultColor; |
2758 overline.style = resultStyle; | 2758 overline.style = resultStyle; |
2759 } | 2759 } |
2760 if (decorations & TextDecorationLineThrough) { | 2760 if (decorations & TextDecorationLineThrough) { |
2761 linethrough.color = resultColor; | 2761 linethrough.color = resultColor; |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3137 { | 3137 { |
3138 if (object1) { | 3138 if (object1) { |
3139 const blink::RenderObject* root = object1; | 3139 const blink::RenderObject* root = object1; |
3140 while (root->parent()) | 3140 while (root->parent()) |
3141 root = root->parent(); | 3141 root = root->parent(); |
3142 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3142 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
3143 } | 3143 } |
3144 } | 3144 } |
3145 | 3145 |
3146 #endif | 3146 #endif |
OLD | NEW |