Changeset 247184 in webkit
- Timestamp:
- Jul 5, 2019 4:19:34 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247182 r247184 1 2019-07-05 Timothy Hatcher <timothy@apple.com> 2 3 Mail's use of punchOutWhiteBackgroundsInDarkMode not working on iOS. 4 https://bugs.webkit.org/show_bug.cgi?id=199534 5 rdar://problem/52586836 6 7 Reviewed by Simon Fraser. 8 9 Tests: css3/color-filters/punch-out-white-backgrounds.html 10 11 * dom/Document.cpp: 12 (WebCore::Document::compositeOperatorForBackgroundColor const): Added. 13 Use CompositeDestinationOut for transparent frames, otherwise CompositeDestinationIn. 14 * dom/Document.h: 15 * rendering/InlineFlowBox.cpp: 16 (WebCore::InlineFlowBox::paintBoxDecorations): Use compositeOperatorForBackgroundColor. 17 * rendering/RenderBox.cpp: 18 (WebCore::RenderBox::paintRootBoxFillLayers): Ditto. 19 (WebCore::RenderBox::paintBackground): Ditto. 20 * rendering/RenderTableCell.cpp: 21 (WebCore::RenderTableCell::paintBackgroundsBehindCell): Ditto. 22 1 23 2019-07-05 Jer Noble <jer.noble@apple.com> 2 24 -
trunk/Source/WebCore/dom/Document.cpp
r247148 r247184 6978 6978 } 6979 6979 6980 CompositeOperator Document::compositeOperatorForBackgroundColor(const Color& color, const RenderObject& renderer) const 6981 { 6982 if (LIKELY(!settings().punchOutWhiteBackgroundsInDarkMode() || !Color::isWhiteColor(color) || !renderer.useDarkAppearance())) 6983 return CompositeSourceOver; 6984 6985 auto* frameView = view(); 6986 if (!frameView) 6987 return CompositeSourceOver; 6988 6989 // Mail on macOS uses a transparent view, and on iOS it is an opaque view. We need to 6990 // use different composite modes to get the right results in this case. 6991 return frameView->isTransparent() ? CompositeDestinationOut : CompositeDestinationIn; 6992 } 6993 6980 6994 void Document::didAssociateFormControl(Element& element) 6981 6995 { -
trunk/Source/WebCore/dom/Document.h
r247148 r247184 40 40 #include "FrameDestructionObserver.h" 41 41 #include "GenericTaskQueue.h" 42 #include "GraphicsTypes.h" 42 43 #include "MediaProducer.h" 43 44 #include "MutationObserver.h" … … 569 570 570 571 OptionSet<StyleColor::Options> styleColorOptions(const RenderStyle*) const; 572 CompositeOperator compositeOperatorForBackgroundColor(const Color&, const RenderObject&) const; 571 573 572 574 WEBCORE_EXPORT Ref<Range> createRange(); -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r245543 r247184 1370 1370 paintBoxShadow(paintInfo, lineStyle, Normal, paintRect); 1371 1371 1372 Color color = lineStyle.visitedDependentColor(CSSPropertyBackgroundColor); 1373 1374 CompositeOperator compositeOp = CompositeSourceOver; 1375 if (renderer().document().settings().punchOutWhiteBackgroundsInDarkMode() && Color::isWhiteColor(color) && renderer().useDarkAppearance()) 1376 compositeOp = CompositeDestinationOut; 1372 auto color = lineStyle.visitedDependentColor(CSSPropertyBackgroundColor); 1373 auto compositeOp = renderer().document().compositeOperatorForBackgroundColor(color, renderer()); 1377 1374 1378 1375 color = lineStyle.colorByApplyingColorFilter(color); -
trunk/Source/WebCore/rendering/RenderBox.cpp
r246432 r247184 1258 1258 1259 1259 auto& style = rootBackgroundRenderer->style(); 1260 1261 1260 auto color = style.visitedDependentColor(CSSPropertyBackgroundColor); 1262 1263 CompositeOperator compositeOp = CompositeSourceOver; 1264 if (document().settings().punchOutWhiteBackgroundsInDarkMode() && Color::isWhiteColor(color) && useDarkAppearance()) 1265 compositeOp = CompositeDestinationOut; 1261 auto compositeOp = document().compositeOperatorForBackgroundColor(color, *this); 1266 1262 1267 1263 paintFillLayers(paintInfo, style.colorByApplyingColorFilter(color), style.backgroundLayers(), view().backgroundRect(), BackgroundBleedNone, compositeOp, rootBackgroundRenderer); … … 1394 1390 return; 1395 1391 1396 Color backgroundColor = style().visitedDependentColor(CSSPropertyBackgroundColor); 1397 1398 CompositeOperator compositeOp = CompositeSourceOver; 1399 if (document().settings().punchOutWhiteBackgroundsInDarkMode() && Color::isWhiteColor(backgroundColor) && useDarkAppearance()) 1400 compositeOp = CompositeDestinationOut; 1392 auto backgroundColor = style().visitedDependentColor(CSSPropertyBackgroundColor); 1393 auto compositeOp = document().compositeOperatorForBackgroundColor(backgroundColor, *this); 1401 1394 1402 1395 paintFillLayers(paintInfo, style().colorByApplyingColorFilter(backgroundColor), style().backgroundLayers(), paintRect, bleedAvoidance, compositeOp); -
trunk/Source/WebCore/rendering/RenderTableCell.cpp
r245543 r247184 1288 1288 auto& bgLayer = style.backgroundLayers(); 1289 1289 1290 CompositeOperator compositeOp = CompositeSourceOver; 1291 Color color = style.visitedDependentColor(CSSPropertyBackgroundColor); 1292 if (document().settings().punchOutWhiteBackgroundsInDarkMode() && Color::isWhiteColor(color) && useDarkAppearance()) 1293 compositeOp = CompositeDestinationOut; 1290 auto color = style.visitedDependentColor(CSSPropertyBackgroundColor); 1291 auto compositeOp = document().compositeOperatorForBackgroundColor(color, *this); 1294 1292 1295 1293 color = style.colorByApplyingColorFilter(color);
Note: See TracChangeset
for help on using the changeset viewer.