-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use StyleColor object instead of Color in WebCore #4068
Use StyleColor object instead of Color in WebCore #4068
Conversation
EWS run on previous version of this PR (hash d4c5033) |
I think this would be easier to work through if this was divided up a bit, starting with a change where StyleColor is a simple wrapper around Color and no behavior changes. It would then be more straightforward to review the additional changes on top of that. |
Source/WebCore/Modules/applicationmanifest/ApplicationManifestParser.cpp
Outdated
Show resolved
Hide resolved
Great work on this so far! |
d4c5033
to
8eed14c
Compare
EWS run on previous version of this PR (hash 8eed14c)
|
8eed14c
to
e5c3664
Compare
EWS run on previous version of this PR (hash e5c3664)
|
e5c3664
to
52f9d80
Compare
EWS run on previous version of this PR (hash 52f9d80) |
52f9d80
to
de702d6
Compare
EWS run on previous version of this PR (hash de702d6)
|
de702d6
to
23f7909
Compare
EWS run on previous version of this PR (hash 23f7909) |
23f7909
to
afdfc69
Compare
41787cb
to
f14e9d3
Compare
EWS run on previous version of this PR (hash f14e9d3)
|
f14e9d3
to
79a59ca
Compare
EWS run on previous version of this PR (hash 79a59ca)
|
79a59ca
to
d182bd1
Compare
EWS run on previous version of this PR (hash d182bd1)
|
|
||
static StyleColor currentColor(); | ||
StyleColor(); | ||
StyleColor(const Color&); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to mark this explicit. I think it reveals some cases where Color is unnecessarily converted to StyleColor. (or maybe it just creates noise, hard to tell).
@@ -1229,11 +1229,11 @@ static void adjustInputElementButtonStyle(RenderStyle& style, const HTMLInputEle | |||
if (!element.active()) | |||
return; | |||
|
|||
auto textColor = style.color(); | |||
auto textColor = style.colorResolvingCurrentColor(style.color()); | |||
if (textColor.isValid()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not from this patch, but it shouldn't ever be invalid either.
d182bd1
to
e08a70a
Compare
EWS run on previous version of this PR (hash e08a70a) |
e08a70a
to
706c61d
Compare
EWS run on previous version of this PR (hash 706c61d)
|
706c61d
to
d7663bb
Compare
EWS run on previous version of this PR (hash d7663bb)
|
d7663bb
to
7865301
Compare
EWS run on previous version of this PR (hash 7865301)
|
7865301
to
ad6098d
Compare
EWS run on current version of this PR (hash ad6098d)
|
https://bugs.webkit.org/show_bug.cgi?id=234691 rdar://problem/87050763 Reviewed by Antti Koivisto. With recent dynamic color features in CSS levels, such as currentcolor or relative color, WebCore need to propagate an unresolved object which will eventually (at render time) compute to an actual platform Color. This patch contains: - the implementation of StyleColor, which now represented a maybe unresolved yet Color. - the specificity of setting the color property (where currentcolor is actually the inherited computed value of color) is now handled in StyleBuilderCustom.h instead of generated by the makeprop.pl script. - missing color initialization in object constructors (such as BorderValue) are fixed. * Source/WebCore/animation/CSSPropertyAnimation.cpp: (WebCore::PropertyWrapperColor::PropertyWrapperColor): (WebCore::PropertyWrapperColor::value const): (WebCore::PropertyWrapperColor::unresolvedValue const): (WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor): (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): (WebCore::PropertyWrapperMaybeInvalidColor::PropertyWrapperMaybeInvalidColor): Deleted. (WebCore::PropertyWrapperMaybeInvalidColor::value const): Deleted. * Source/WebCore/css/CSSProperties.json: * Source/WebCore/css/ComputedStyleExtractor.cpp: (WebCore::ComputedStyleExtractor::currentColorOrValidColor const): (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * Source/WebCore/css/ComputedStyleExtractor.h: * Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::adjustSVGPaint const): (WebCore::ComputedStyleExtractor::svgPropertyValue): (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const): Deleted. * Source/WebCore/css/StyleColor.cpp: (WebCore::StyleColor::currentColor): (WebCore::serializationForRenderTreeAsText): (WebCore::serializationForCSS): (WebCore::StyleColor::colorFromAbsoluteKeyword): (WebCore::StyleColor::colorFromKeyword): (WebCore::operator<<): (WebCore::StyleColor::debugDescription const): (WebCore::StyleColor::resolveColor const): (WebCore::StyleColor::resolveColorWithoutCurrentColor const): (WebCore::StyleColor::isCurrentColor const): (WebCore::StyleColor::isAbsoluteColor const): (WebCore::StyleColor::absoluteColor const): (WebCore::StyleColor::StyleColor): * Source/WebCore/css/StyleColor.h: * Source/WebCore/css/makeprop.pl: (generateInheritValueSetter): (generateValueSetter): (handleCurrentColorValue): Deleted. * Source/WebCore/dom/Document.h: * Source/WebCore/editing/EditingStyle.cpp: (WebCore::EditingStyle::removeTextFillAndStrokeColorsIfNeeded): * Source/WebCore/editing/FrameSelection.cpp: (WebCore::CaretBase::computeCaretColor): * Source/WebCore/editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): * Source/WebCore/page/DragController.cpp: (WebCore::DragController::insertDroppedImagePlaceholdersAtCaret): * Source/WebCore/rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::calculateHighlightColor const): * Source/WebCore/rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::adjustButtonLikeControlStyle const): * Source/WebCore/rendering/RenderTreeAsText.cpp: (WebCore::RenderTreeAsText::writeRenderObject): * Source/WebCore/rendering/StyledMarkedText.cpp: (WebCore::resolveStyleForMarkedText): * Source/WebCore/rendering/style/BorderValue.cpp: (WebCore::BorderValue::BorderValue): (WebCore::BorderValue::isTransparent const): * Source/WebCore/rendering/style/BorderValue.h: (WebCore::BorderValue::setColor): (WebCore::BorderValue::color const): * Source/WebCore/rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::unresolvedColorForProperty const): (WebCore::RenderStyle::currentColor): (WebCore::RenderStyle::isCurrentColor): (WebCore::RenderStyle::colorResolvingCurrentColor const): (WebCore::RenderStyle::resolvedColorAndColorFilter const): (WebCore::RenderStyle::initialTapHighlightColor): * Source/WebCore/rendering/style/RenderStyle.h: (WebCore::RenderStyle::tapHighlightColor const): (WebCore::RenderStyle::setBackgroundColor): (WebCore::RenderStyle::setBorderLeftColor): (WebCore::RenderStyle::setBorderRightColor): (WebCore::RenderStyle::setBorderTopColor): (WebCore::RenderStyle::setBorderBottomColor): (WebCore::RenderStyle::setOutlineColor): (WebCore::RenderStyle::setTextStrokeColor): (WebCore::RenderStyle::setTextFillColor): (WebCore::RenderStyle::setCaretColor): (WebCore::RenderStyle::setAccentColor): (WebCore::RenderStyle::setColumnRuleColor): (WebCore::RenderStyle::setTextDecorationColor): (WebCore::RenderStyle::setTextEmphasisColor): (WebCore::RenderStyle::setTapHighlightColor): (WebCore::RenderStyle::strokeColor const): (WebCore::RenderStyle::setStrokeColor): (WebCore::RenderStyle::setVisitedLinkStrokeColor): (WebCore::RenderStyle::visitedLinkStrokeColor const): (WebCore::RenderStyle::initialStrokeColor): (WebCore::RenderStyle::fillPaintColor const): (WebCore::RenderStyle::setFillPaintColor): (WebCore::RenderStyle::strokePaintColor const): (WebCore::RenderStyle::setStrokePaintColor): (WebCore::RenderStyle::setStopColor): (WebCore::RenderStyle::setFloodColor): (WebCore::RenderStyle::setLightingColor): (WebCore::RenderStyle::backgroundColorEqualsToColorIgnoringVisited const): (WebCore::RenderStyle::initialTextStrokeColor): (WebCore::RenderStyle::initialTextDecorationColor): (WebCore::RenderStyle::initialBackgroundColor): (WebCore::RenderStyle::initialTextEmphasisColor): (WebCore::RenderStyle::setVisitedLinkBackgroundColor): (WebCore::RenderStyle::setVisitedLinkBorderLeftColor): (WebCore::RenderStyle::setVisitedLinkBorderRightColor): (WebCore::RenderStyle::setVisitedLinkBorderBottomColor): (WebCore::RenderStyle::setVisitedLinkBorderTopColor): (WebCore::RenderStyle::setVisitedLinkOutlineColor): (WebCore::RenderStyle::setVisitedLinkColumnRuleColor): (WebCore::RenderStyle::setVisitedLinkTextDecorationColor): (WebCore::RenderStyle::setVisitedLinkTextEmphasisColor): (WebCore::RenderStyle::setVisitedLinkTextFillColor): (WebCore::RenderStyle::setVisitedLinkTextStrokeColor): (WebCore::RenderStyle::setVisitedLinkCaretColor): (WebCore::RenderStyle::borderLeftColor const): (WebCore::RenderStyle::borderRightColor const): (WebCore::RenderStyle::borderTopColor const): (WebCore::RenderStyle::borderBottomColor const): (WebCore::RenderStyle::backgroundColor const): (WebCore::RenderStyle::columnRuleColor const): (WebCore::RenderStyle::outlineColor const): (WebCore::RenderStyle::textEmphasisColor const): (WebCore::RenderStyle::textFillColor const): (WebCore::RenderStyle::initialTextFillColor): (WebCore::RenderStyle::textStrokeColor const): (WebCore::RenderStyle::caretColor const): (WebCore::RenderStyle::visitedLinkBackgroundColor const): (WebCore::RenderStyle::visitedLinkBorderLeftColor const): (WebCore::RenderStyle::visitedLinkBorderRightColor const): (WebCore::RenderStyle::visitedLinkBorderBottomColor const): (WebCore::RenderStyle::visitedLinkBorderTopColor const): (WebCore::RenderStyle::visitedLinkOutlineColor const): (WebCore::RenderStyle::visitedLinkColumnRuleColor const): (WebCore::RenderStyle::textDecorationColor const): (WebCore::RenderStyle::visitedLinkTextDecorationColor const): (WebCore::RenderStyle::visitedLinkTextEmphasisColor const): (WebCore::RenderStyle::visitedLinkTextFillColor const): (WebCore::RenderStyle::visitedLinkTextStrokeColor const): (WebCore::RenderStyle::visitedLinkCaretColor const): (WebCore::RenderStyle::stopColor const): (WebCore::RenderStyle::floodColor const): (WebCore::RenderStyle::lightingColor const): (WebCore::RenderStyle::accentColor const): (WebCore::RenderStyle::currentColor): Deleted. (WebCore::RenderStyle::isCurrentColor): Deleted. * Source/WebCore/rendering/style/SVGRenderStyle.h: (WebCore::SVGRenderStyle::initialFillPaintColor): (WebCore::SVGRenderStyle::initialStrokePaintColor): (WebCore::SVGRenderStyle::initialStopColor): (WebCore::SVGRenderStyle::initialFloodColor): (WebCore::SVGRenderStyle::initialLightingColor): (WebCore::SVGRenderStyle::fillPaintColor const): (WebCore::SVGRenderStyle::strokePaintColor const): (WebCore::SVGRenderStyle::stopColor const): (WebCore::SVGRenderStyle::floodColor const): (WebCore::SVGRenderStyle::lightingColor const): (WebCore::SVGRenderStyle::visitedLinkFillPaintColor const): (WebCore::SVGRenderStyle::visitedLinkStrokePaintColor const): (WebCore::SVGRenderStyle::setFillPaint): (WebCore::SVGRenderStyle::setStrokePaint): (WebCore::SVGRenderStyle::setStopColor): (WebCore::SVGRenderStyle::setFloodColor): (WebCore::SVGRenderStyle::setLightingColor): * Source/WebCore/rendering/style/SVGRenderStyleDefs.h: * Source/WebCore/rendering/style/StyleBackgroundData.h: * Source/WebCore/rendering/style/StyleInheritedData.h: * Source/WebCore/rendering/style/StyleMultiColData.h: * Source/WebCore/rendering/style/StyleRareInheritedData.cpp: * Source/WebCore/rendering/style/StyleRareInheritedData.h: * Source/WebCore/rendering/style/StyleRareNonInheritedData.h: * Source/WebCore/rendering/svg/RenderSVGResource.cpp: (WebCore::inheritColorFromParentStyleIfNeeded): (WebCore::requestPaintingResource): * Source/WebCore/style/StyleBuilderConverter.h: (WebCore::Style::BuilderConverter::convertTapHighlightColor): * Source/WebCore/style/StyleBuilderCustom.h: (WebCore::Style::BuilderCustom::applyInheritCaretColor): (WebCore::Style::colorAndSVGPaintType): (WebCore::Style::BuilderCustom::applyValueColor): * Source/WebCore/style/StyleBuilderState.cpp: (WebCore::Style::BuilderState::colorFromPrimitiveValue const): (WebCore::Style::BuilderState::colorFromPrimitiveValueWithResolvedCurrentColor const): * Source/WebCore/style/StyleBuilderState.h: * Source/WebCore/svg/SVGFEDiffuseLightingElement.cpp: (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute): (WebCore::SVGFEDiffuseLightingElement::createFilterEffect const): * Source/WebCore/svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::setFilterEffectAttribute): (WebCore::SVGFEDropShadowElement::createFilterEffect const): * Source/WebCore/svg/SVGFEFloodElement.cpp: (WebCore::SVGFEFloodElement::setFilterEffectAttribute): (WebCore::SVGFEFloodElement::createFilterEffect const): * Source/WebCore/svg/SVGFESpecularLightingElement.cpp: (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute): (WebCore::SVGFESpecularLightingElement::createFilterEffect const): * Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::sendTapHighlightForNodeIfNecessary): Canonical link: https://commits.webkit.org/255095@main
ad6098d
to
b6c0182
Compare
Committed 255095@main (b6c0182): https://commits.webkit.org/255095@main Reviewed commits have been landed. Closing PR #4068 and removing active labels. |
b6c0182
ad6098d
🛠 mac-debug🧪 ios-wk2🛠 mac-AS-debug🧪 gtk-wk2🧪 api-mac🧪 mac-wk1🧪 mac-AS-debug-wk2