Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: Source/core/layout/LayoutObject.cpp

Issue 950623002: Store resolved color in AppliedTextDecoration (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: removed inherited_flags.m_textunderline Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 #include "core/layout/LayoutObjectInlines.h" 63 #include "core/layout/LayoutObjectInlines.h"
64 #include "core/layout/LayoutPart.h" 64 #include "core/layout/LayoutPart.h"
65 #include "core/layout/LayoutScrollbarPart.h" 65 #include "core/layout/LayoutScrollbarPart.h"
66 #include "core/layout/LayoutTableCaption.h" 66 #include "core/layout/LayoutTableCaption.h"
67 #include "core/layout/LayoutTableCell.h" 67 #include "core/layout/LayoutTableCell.h"
68 #include "core/layout/LayoutTableCol.h" 68 #include "core/layout/LayoutTableCol.h"
69 #include "core/layout/LayoutTableRow.h" 69 #include "core/layout/LayoutTableRow.h"
70 #include "core/layout/LayoutTheme.h" 70 #include "core/layout/LayoutTheme.h"
71 #include "core/layout/LayoutView.h" 71 #include "core/layout/LayoutView.h"
72 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h" 72 #include "core/layout/compositing/DeprecatedPaintLayerCompositor.h"
73 #include "core/style/AppliedTextDecoration.h"
73 #include "core/style/ContentData.h" 74 #include "core/style/ContentData.h"
74 #include "core/style/ShadowList.h" 75 #include "core/style/ShadowList.h"
75 #include "core/page/AutoscrollController.h" 76 #include "core/page/AutoscrollController.h"
76 #include "core/page/EventHandler.h" 77 #include "core/page/EventHandler.h"
77 #include "core/page/Page.h" 78 #include "core/page/Page.h"
78 #include "core/paint/DeprecatedPaintLayer.h" 79 #include "core/paint/DeprecatedPaintLayer.h"
79 #include "core/paint/ObjectPainter.h" 80 #include "core/paint/ObjectPainter.h"
80 #include "platform/JSONValues.h" 81 #include "platform/JSONValues.h"
81 #include "platform/RuntimeEnabledFeatures.h" 82 #include "platform/RuntimeEnabledFeatures.h"
82 #include "platform/TraceEvent.h" 83 #include "platform/TraceEvent.h"
(...skipping 2749 matching lines...) Expand 10 before | Expand all | Expand 10 after
2832 do { 2833 do {
2833 styleToUse = curr->style(firstlineStyle); 2834 styleToUse = curr->style(firstlineStyle);
2834 currDecs = styleToUse->textDecoration(); 2835 currDecs = styleToUse->textDecoration();
2835 currDecs &= decorations; 2836 currDecs &= decorations;
2836 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio nColor); 2837 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio nColor);
2837 resultStyle = styleToUse->textDecorationStyle(); 2838 resultStyle = styleToUse->textDecorationStyle();
2838 // Parameter 'decorations' is cast as an int to enable the bitwise opera tions below. 2839 // Parameter 'decorations' is cast as an int to enable the bitwise opera tions below.
2839 if (currDecs) { 2840 if (currDecs) {
2840 if (currDecs & TextDecorationUnderline) { 2841 if (currDecs & TextDecorationUnderline) {
2841 decorations &= ~TextDecorationUnderline; 2842 decorations &= ~TextDecorationUnderline;
2842 underline.color = resultColor; 2843 underline.setColor(resultColor);
2843 underline.style = resultStyle; 2844 underline.setStyle(resultStyle);
2844 } 2845 }
2845 if (currDecs & TextDecorationOverline) { 2846 if (currDecs & TextDecorationOverline) {
2846 decorations &= ~TextDecorationOverline; 2847 decorations &= ~TextDecorationOverline;
2847 overline.color = resultColor; 2848 overline.setColor(resultColor);
2848 overline.style = resultStyle; 2849 overline.setStyle(resultStyle);
2849 } 2850 }
2850 if (currDecs & TextDecorationLineThrough) { 2851 if (currDecs & TextDecorationLineThrough) {
2851 decorations &= ~TextDecorationLineThrough; 2852 decorations &= ~TextDecorationLineThrough;
2852 linethrough.color = resultColor; 2853 linethrough.setColor(resultColor);
2853 linethrough.style = resultStyle; 2854 linethrough.setStyle(resultStyle);
2854 } 2855 }
2855 } 2856 }
2856 if (curr->isRubyText()) 2857 if (curr->isRubyText())
2857 return; 2858 return;
2858 curr = curr->parent(); 2859 curr = curr->parent();
2859 if (curr && curr->isAnonymousBlock() && toLayoutBlock(curr)->continuatio n()) 2860 if (curr && curr->isAnonymousBlock() && toLayoutBlock(curr)->continuatio n())
2860 curr = toLayoutBlock(curr)->continuation(); 2861 curr = toLayoutBlock(curr)->continuation();
2861 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc horElement(*curr->node()) && !isHTMLFontElement(*curr->node())))); 2862 } while (curr && decorations && (!quirksMode || !curr->node() || (!isHTMLAnc horElement(*curr->node()) && !isHTMLFontElement(*curr->node()))));
2862 2863
2863 // If we bailed out, use the element we bailed out at (typically a <font> or <a> element). 2864 // If we bailed out, use the element we bailed out at (typically a <font> or <a> element).
2864 if (decorations && curr) { 2865 if (decorations && curr) {
2865 styleToUse = curr->style(firstlineStyle); 2866 styleToUse = curr->style(firstlineStyle);
2866 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio nColor); 2867 resultColor = styleToUse->visitedDependentColor(CSSPropertyTextDecoratio nColor);
2867 if (decorations & TextDecorationUnderline) { 2868 if (decorations & TextDecorationUnderline) {
2868 underline.color = resultColor; 2869 underline.setColor(resultColor);
2869 underline.style = resultStyle; 2870 underline.setStyle(resultStyle);
2870 } 2871 }
2871 if (decorations & TextDecorationOverline) { 2872 if (decorations & TextDecorationOverline) {
2872 overline.color = resultColor; 2873 overline.setColor(resultColor);
2873 overline.style = resultStyle; 2874 overline.setStyle(resultStyle);
2874 } 2875 }
2875 if (decorations & TextDecorationLineThrough) { 2876 if (decorations & TextDecorationLineThrough) {
2876 linethrough.color = resultColor; 2877 linethrough.setColor(resultColor);
2877 linethrough.style = resultStyle; 2878 linethrough.setStyle(resultStyle);
2878 } 2879 }
2879 } 2880 }
2880 } 2881 }
2881 2882
2882 void LayoutObject::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) 2883 void LayoutObject::addAnnotatedRegions(Vector<AnnotatedRegionValue>& regions)
2883 { 2884 {
2884 // Convert the style regions to absolute coordinates. 2885 // Convert the style regions to absolute coordinates.
2885 if (style()->visibility() != VISIBLE || !isBox()) 2886 if (style()->visibility() != VISIBLE || !isBox())
2886 return; 2887 return;
2887 2888
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
3302 { 3303 {
3303 if (object1) { 3304 if (object1) {
3304 const blink::LayoutObject* root = object1; 3305 const blink::LayoutObject* root = object1;
3305 while (root->parent()) 3306 while (root->parent())
3306 root = root->parent(); 3307 root = root->parent();
3307 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3308 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3308 } 3309 }
3309 } 3310 }
3310 3311
3311 #endif 3312 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698