[webkit-changes] [WebKit/WebKit] f4c2de: REGRESSION(268354 at main): Text gets shadow if its c...

Said Abou-Hallawa noreply at github.com
Wed Nov 8 16:42:06 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f4c2de375a56df1d82f6701bb98623996f26c9a6
      https://github.com/WebKit/WebKit/commit/f4c2de375a56df1d82f6701bb98623996f26c9a6
  Author: Said Abou-Hallawa <said at apple.com>
  Date:   2023-11-08 (Wed, 08 Nov 2023)

  Changed paths:
    A LayoutTests/fast/text/text-container-filter-drop-shadow-expected.html
    A LayoutTests/fast/text/text-container-filter-drop-shadow.html
    M Source/WebCore/platform/graphics/GraphicsContext.cpp
    M Source/WebCore/platform/graphics/GraphicsContext.h
    M Source/WebCore/platform/graphics/GraphicsContextState.cpp
    M Source/WebCore/platform/graphics/GraphicsContextState.h
    M Source/WebCore/platform/graphics/ShadowBlur.cpp
    M Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
    M Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp
    M Source/WebCore/platform/graphics/cg/GraphicsContextCG.h
    M Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp
    M Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp
    M Source/WebCore/platform/graphics/displaylists/DisplayListItem.h
    M Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp
    M Source/WebCore/platform/graphics/displaylists/DisplayListItems.h
    M Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h
    M Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.cpp
    M Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.h
    M Source/WebCore/rendering/EllipsisBoxPainter.cpp
    M Source/WebCore/rendering/TextDecorationPainter.cpp
    M Source/WebCore/rendering/TextPainter.cpp
    M Source/WebCore/rendering/svg/RenderSVGRect.cpp
    M Source/WebCore/rendering/svg/legacy/LegacyRenderSVGRect.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp
    M Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h
    M Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
    M Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp
    M Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h
    M Source/WebKit/WebProcess/WebPage/FindController.cpp
    M Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.cpp

  Log Message:
  -----------
  REGRESSION(268354 at main): Text gets shadow if its container has a filter drop-shadow
https://bugs.webkit.org/show_bug.cgi?id=264354
rdar://117987393

Reviewed by Simon Fraser.

GraphicsContextState used to have two different entities one for drop-shadow and
and another one for filter-effect-style. After 266544 at main they became one entity
represented by GraphicsStyle.

This change did not consider the drop-shadow and the filter-effect-style can be
two different states and can coexist. So it caused the following problem: If the
text does not have text-shadow but its ancestor has filter drop-shadow, the text
will rendered with the drop-shadow of its ancestor.

To fix this bug, these two states have to be split again so rendering the text
does not get confused by the filter effect style. The drop-shadow can still be
represented as GraphicsDropShadow.

* LayoutTests/fast/text/text-container-filter-drop-shadow-expected.html: Added.
* LayoutTests/fast/text/text-container-filter-drop-shadow.html: Added.
* Source/WebCore/platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::clearShadow): Deleted.
(WebCore::GraphicsContext::hasVisibleShadow const): Deleted.
(WebCore::GraphicsContext::hasBlurredShadow const): Deleted.
(WebCore::GraphicsContext::hasShadow const): Deleted.
* Source/WebCore/platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::setDropShadow):
(WebCore::GraphicsContext::clearDropShadow):
(WebCore::GraphicsContext::hasBlurredDropShadow const):
(WebCore::GraphicsContext::hasDropShadow const):
* Source/WebCore/platform/graphics/GraphicsContextState.cpp:
(WebCore::GraphicsContextState::mergeLastChanges):
(WebCore::GraphicsContextState::mergeAllChanges):
(WebCore::stateChangeName):
(WebCore::GraphicsContextState::dump const):
(WebCore::GraphicsContextState::dropShadow const): Deleted.
* Source/WebCore/platform/graphics/GraphicsContextState.h:
(WebCore::GraphicsContextState::dropShadow const):
(WebCore::GraphicsContextState::setDropShadow):
* Source/WebCore/platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::drawShadowBuffer):
(WebCore::ShadowBlur::drawRectShadow):
(WebCore::ShadowBlur::drawInsetShadow):
* Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContextCairo::didUpdateState):
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContextCG::fillPath):
(WebCore::GraphicsContextCG::strokePath):
(WebCore::GraphicsContextCG::fillRect):
(WebCore::GraphicsContextCG::setCGShadow):
(WebCore::GraphicsContextCG::didUpdateState):
(WebCore::GraphicsContextCG::strokeRect):
(WebCore::GraphicsContextCG::canUseShadowBlur const):
* Source/WebCore/platform/graphics/cg/GraphicsContextCG.h:
* Source/WebCore/platform/graphics/coretext/DrawGlyphsRecorderCoreText.cpp:
(WebCore::DrawGlyphsRecorder::populateInternalContext):
(WebCore::DrawGlyphsRecorder::updateShadow):
* Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:
(WebCore::FontCascade::drawGlyphs):
* Source/WebCore/platform/graphics/displaylists/DisplayListItem.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::ClearDropShadow::apply const):
(WebCore::DisplayList::ClearShadow::apply const): Deleted.
* Source/WebCore/platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::ClearShadow::dump const): Deleted.
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.h:
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.cpp:
(WebCore::DisplayList::RecorderImpl::recordClearDropShadow):
(WebCore::DisplayList::RecorderImpl::recordClearShadow): Deleted.
* Source/WebCore/platform/graphics/displaylists/DisplayListRecorderImpl.h:
* Source/WebCore/rendering/EllipsisBoxPainter.cpp:
(WebCore::EllipsisBoxPainter::paint):
* Source/WebCore/rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintBackgroundDecorations):
* Source/WebCore/rendering/TextPainter.cpp:
(WebCore::ShadowApplier::~ShadowApplier):
* Source/WebCore/rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::fillShape const):
* Source/WebCore/rendering/svg/legacy/LegacyRenderSVGRect.cpp:
(WebCore::LegacyRenderSVGRect::fillShape const):
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp:
(WebKit::RemoteDisplayListRecorder::clearDropShadow):
(WebKit::RemoteDisplayListRecorder::clearShadow): Deleted.
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h:
* Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.messages.in:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.cpp:
(WebKit::RemoteDisplayListRecorderProxy::recordClearDropShadow):
(WebKit::RemoteDisplayListRecorderProxy::recordClearShadow): Deleted.
* Source/WebKit/WebProcess/GPU/graphics/RemoteDisplayListRecorderProxy.h:
* Source/WebKit/WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::drawRect):
* Source/WebKit/WebProcess/WebPage/WebFoundTextRangeController.cpp:
(WebKit::WebFoundTextRangeController::drawRect):

Canonical link: https://commits.webkit.org/270414@main




More information about the webkit-changes mailing list