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

Issue 20061003: Move isValid/isCurrentColor from Color to StyleColor (Closed)

Created:
7 years, 5 months ago by eae
Modified:
7 years, 5 months ago
Reviewers:
jamesr, eseidel
CC:
blink-reviews, shans, eae+blinkwatch, apavlov+blink_chromium.org, adamk+blink_chromium.org, pdr, rjwright, aandrey+blink_chromium.org, jamesr, caseq+blink_chromium.org, Steve Block, alancutter (OOO until 2018), Mike Lawther (Google), yurys+blink_chromium.org, Timothy Loh, danakj, dstockwell, dglazkov+blink, Rik, jchaffraix+rendering, devtools-reviews_chromium.org, pdr., Eric Willigers, kenneth.christiansen, loislo+blink_chromium.org, lushnikov+blink_chromium.org, eustas+blink_chromium.org, paulirish+reviews_chromium.org, darktears, vcarbune.chromium, aboxhall, alph+blink_chromium.org, leviw+renderwatch, vsevik+blink_chromium.org, pfeldman+blink_chromium.org, dmazzoni, f(malita), Stephen Chennney, jeez
Visibility:
Public.

Description

Move isValid/isCurrentColor from Color to StyleColor Change style resolution and RenderStyle to use the new StyleColor class instead of the platform Color class to represent a color and only convert to the lower level color class at paint/query time. This allows the currentColor logic to be contained within RenderStyle and friends, allows style using currentColor to be cached and shared and hides the complexity from style resolution. It also moves the isValid concept from Color into StyleColor, thereby reducing the size of the lower-level Color class to 32 bits. The SVG code isn't as clean as I'd like it to be, mainly due to the fact that SVG has a separate currentColor implementation. I'd like to merge the two or at least make them work together but that'll have to follow in a separate change as this one is big enough as is. BUG=259121 R=eseidel@chromium.org,jamesr@chromium.org TEST=Covered by existing fast/css tests Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=154797

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+646 lines, -482 lines) Patch
M Source/core/accessibility/AccessibilityNodeObject.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/accessibility/AccessibilityTable.cpp View 5 chunks +5 lines, -5 lines 0 comments Download
M Source/core/core.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/css/CSSComputedStyleDeclaration.h View 2 chunks +4 lines, -2 lines 0 comments Download
M Source/core/css/CSSComputedStyleDeclaration.cpp View 14 chunks +34 lines, -17 lines 0 comments Download
M Source/core/css/CSSGradientValue.h View 3 chunks +3 lines, -2 lines 0 comments Download
M Source/core/css/CSSGradientValue.cpp View 4 chunks +4 lines, -4 lines 0 comments Download
M Source/core/css/CSSParser-in.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M Source/core/css/CSSToStyleMap.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/SVGCSSComputedStyleDeclaration.cpp View 2 chunks +6 lines, -3 lines 0 comments Download
M Source/core/css/StyleColor.h View 2 chunks +5 lines, -2 lines 0 comments Download
A Source/core/css/StyleColor.cpp View 1 chunk +86 lines, -0 lines 2 comments Download
M Source/core/css/resolver/ElementStyleResources.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/resolver/ElementStyleResources.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/css/resolver/FilterOperationResolver.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/css/resolver/MatchedPropertiesCache.cpp View 1 chunk +0 lines, -2 lines 0 comments Download
M Source/core/css/resolver/StyleBuilderCustom.cpp View 5 chunks +8 lines, -8 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 chunk +0 lines, -4 lines 0 comments Download
M Source/core/css/resolver/StyleResolverState.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/TextLinkColors.h View 2 chunks +11 lines, -11 lines 0 comments Download
M Source/core/dom/TextLinkColors.cpp View 3 chunks +6 lines, -6 lines 0 comments Download
M Source/core/editing/FrameSelection.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/ColorInputType.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/ColorInputType.cpp View 6 chunks +8 lines, -8 lines 0 comments Download
M Source/core/html/HTMLElement.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/track/InbandTextTrack.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/track/TextTrackCueGeneric.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/track/TextTrackCueGeneric.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/inspector/InspectorFrontendHost.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/page/Frame.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/page/Frame.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/page/FrameView.h View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/page/FrameView.cpp View 5 chunks +14 lines, -14 lines 0 comments Download
M Source/core/page/animation/CSSPropertyAnimation.cpp View 10 chunks +36 lines, -31 lines 0 comments Download
M Source/core/platform/graphics/Color.h View 5 chunks +10 lines, -20 lines 0 comments Download
M Source/core/platform/graphics/Color.cpp View 3 chunks +1 line, -45 lines 0 comments Download
M Source/core/platform/graphics/DrawLooper.cpp View 1 chunk +2 lines, -6 lines 0 comments Download
M Source/core/platform/graphics/GraphicsContext.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/platform/graphics/GraphicsLayer.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/platform/graphics/ShadowBlur.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/EllipsisBox.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M Source/core/rendering/InlineTextBox.cpp View 4 chunks +7 lines, -5 lines 0 comments Download
M Source/core/rendering/RenderBox.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/rendering/RenderBoxModelObject.cpp View 4 chunks +5 lines, -5 lines 0 comments Download
M Source/core/rendering/RenderMenuList.cpp View 1 chunk +6 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderObject.h View 3 chunks +54 lines, -8 lines 0 comments Download
M Source/core/rendering/RenderObject.cpp View 2 chunks +20 lines, -17 lines 0 comments Download
M Source/core/rendering/RenderTableCell.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderTheme.h View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderTheme.cpp View 6 chunks +43 lines, -22 lines 0 comments Download
M Source/core/rendering/RenderThemeChromiumMac.mm View 3 chunks +4 lines, -4 lines 0 comments Download
M Source/core/rendering/RenderThemeChromiumWin.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderTreeAsText.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/rendering/style/BorderValue.h View 5 chunks +11 lines, -8 lines 0 comments Download
M Source/core/rendering/style/CachedUAStyle.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/style/CollapsedBorderValue.h View 4 chunks +8 lines, -5 lines 0 comments Download
M Source/core/rendering/style/RenderStyle.h View 18 chunks +68 lines, -73 lines 0 comments Download
M Source/core/rendering/style/RenderStyle.cpp View 6 chunks +28 lines, -13 lines 0 comments Download
M Source/core/rendering/style/ShadowData.h View 5 chunks +5 lines, -5 lines 0 comments Download
M Source/core/rendering/style/StyleBackgroundData.h View 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/rendering/style/StyleImage.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/style/StyleInheritedData.h View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/rendering/style/StyleMultiColData.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/rendering/style/StyleRareInheritedData.h View 3 chunks +8 lines, -8 lines 0 comments Download
M Source/core/rendering/style/StyleRareInheritedData.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/rendering/style/StyleRareNonInheritedData.h View 2 chunks +9 lines, -8 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResource.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGResource.cpp View 8 chunks +9 lines, -10 lines 0 comments Download
M Source/core/rendering/svg/RenderSVGShape.cpp View 4 chunks +6 lines, -6 lines 0 comments Download
M Source/core/rendering/svg/SVGInlineTextBox.cpp View 4 chunks +4 lines, -4 lines 0 comments Download
M Source/core/rendering/svg/SVGRenderTreeAsText.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/svg/SVGRenderingContext.cpp View 1 chunk +3 lines, -1 line 0 comments Download
M Source/core/scripts/templates/StyleBuilderFunctions.cpp.tmpl View 3 chunks +4 lines, -4 lines 0 comments Download
M Source/core/svg/SVGAnimatedColor.cpp View 2 chunks +5 lines, -5 lines 0 comments Download
M Source/core/svg/SVGColor.h View 4 chunks +10 lines, -3 lines 0 comments Download
M Source/core/svg/SVGColor.cpp View 3 chunks +10 lines, -6 lines 0 comments Download
M Source/core/svg/SVGStopElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/testing/Internals.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/web/ColorChooserPopupUIController.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/web/LinkHighlight.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/web/WebViewImpl.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/web/mac/WebSubstringUtil.mm View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
eae
7 years, 5 months ago (2013-07-23 22:10:11 UTC) #1
eseidel
lgtm
7 years, 5 months ago (2013-07-23 22:12:54 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eae@chromium.org/20061003/1
7 years, 5 months ago (2013-07-23 22:13:31 UTC) #3
commit-bot: I haz the power
Change committed as 154797
7 years, 5 months ago (2013-07-24 00:52:54 UTC) #4
tfarina
https://codereview.chromium.org/20061003/diff/1/Source/core/css/StyleColor.cpp File Source/core/css/StyleColor.cpp (right): https://codereview.chromium.org/20061003/diff/1/Source/core/css/StyleColor.cpp#newcode32 Source/core/css/StyleColor.cpp:32: using namespace std; where are you using std types ...
7 years, 5 months ago (2013-07-24 01:16:00 UTC) #5
eae
7 years, 5 months ago (2013-07-24 18:47:30 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/20061003/diff/1/Source/core/css/StyleColor.cpp
File Source/core/css/StyleColor.cpp (right):

https://codereview.chromium.org/20061003/diff/1/Source/core/css/StyleColor.cp...
Source/core/css/StyleColor.cpp:32: using namespace std;
On 2013/07/24 01:16:00, tfarina wrote:
> where are you using std types here? do you need this using directive?

Good catch, left over from an earlier iteration. I'll remove it.

Powered by Google App Engine
This is Rietveld 408576698