Changeset 151555 in webkit
- Timestamp:
- Jun 13, 2013 9:50:40 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r151549 r151555 1 2013-06-13 Max Vujovic <mvujovic@adobe.com> 2 3 [CSS Regions] -webkit-background-clip: text; does not clip the background in regions 4 https://bugs.webkit.org/show_bug.cgi?id=117566 5 6 Reviewed by Alexandru Chiculita. 7 8 * fast/regions/webkit-background-clip-text-expected.html: Added. 9 * fast/regions/webkit-background-clip-text.html: Added. 10 1 11 2013-06-13 Yuki Sekiguchi <yuki.sekiguchi@access-company.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r151554 r151555 1 2013-06-13 Max Vujovic <mvujovic@adobe.com> 2 3 [CSS Regions] -webkit-background-clip: text; does not clip the background in regions 4 https://bugs.webkit.org/show_bug.cgi?id=117566 5 6 Reviewed by Alexandru Chiculita. 7 8 This patch enables -webkit-background-clip: text; on regions. 9 10 Test: fast/regions/webkit-background-clip-text.html 11 12 * rendering/RenderFlowThread.cpp: 13 (WebCore::RenderFlowThread::paintFlowThreadPortionInRegion): 14 Force black text if we're in the text clip paint phase. This makes sure the text's alpha 15 channel does not affect the final opacity of the background clipping result. Rather, 16 the text's alpha channel affects the amount of blending between the text color 17 and the background. 18 * rendering/RenderRegion.cpp: 19 (WebCore::shouldPaintRegionContentsInPhase): 20 Factor out a function to check if we should paint the region contents in a particular 21 phase. Add "PaintPhaseTextClip" so that we draw the contents in the text clipping phase. 22 (WebCore::RenderRegion::paintObject): 23 Call shouldPaintRegionContentsInPhase instead of doing the phase checks directly in this 24 function. Move, update, and clarify the surrounding comments. 25 1 26 2013-06-13 Anton Obzhirov <a.obzhirov@samsung.com> 2 27 -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r151309 r151555 304 304 info.rect.moveBy(-adjustedPaintOffset); 305 305 306 layer()->paint(context, info.rect, 0, 0, region, RenderLayer::PaintLayerTemporaryClipRects); 306 PaintBehavior paintBehavior = 0; 307 if (info.phase == PaintPhaseTextClip) 308 paintBehavior |= PaintBehaviorForceBlackText; 309 310 layer()->paint(context, info.rect, paintBehavior, 0, region, RenderLayer::PaintLayerTemporaryClipRects); 307 311 308 312 context->restore(); -
trunk/Source/WebCore/rendering/RenderRegion.cpp
r151554 r151555 152 152 } 153 153 154 static bool shouldPaintRegionContentsInPhase(PaintPhase phase) 155 { 156 return phase == PaintPhaseBlockBackground 157 || phase == PaintPhaseChildBlockBackground 158 || phase == PaintPhaseSelection 159 || phase == PaintPhaseTextClip; 160 } 161 154 162 void RenderRegion::paintObject(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 155 163 { … … 162 170 return; 163 171 164 // Delegate painting of content in region to RenderFlowThread. 165 // RenderFlowThread is a self painting layer (being a positioned object) who is painting its children, the collected objects. 166 // Since we do not want to paint the flow thread content multiple times (for each painting phase of the region object), 167 // we allow the flow thread painting only for the selection and the background phase. 168 if (paintInfo.phase != PaintPhaseBlockBackground && paintInfo.phase != PaintPhaseChildBlockBackground && paintInfo.phase != PaintPhaseSelection) 169 return; 170 172 // We do not want to paint a region's contents multiple times (for each paint phase of the region object). 173 // Thus, we only paint the region's contents in certain phases. 174 if (!shouldPaintRegionContentsInPhase(paintInfo.phase)) 175 return; 176 177 // Delegate the painting of a region's contents to RenderFlowThread. 178 // RenderFlowThread is a self painting layer because it's a positioned object. 179 // RenderFlowThread paints its children, the collected objects. 171 180 setRegionObjectsRegionStyle(); 172 181 m_flowThread->paintFlowThreadPortionInRegion(paintInfo, this, flowThreadPortionRect(), flowThreadPortionOverflowRect(), LayoutPoint(paintOffset.x() + borderLeft() + paddingLeft(), paintOffset.y() + borderTop() + paddingTop()));
Note: See TracChangeset
for help on using the changeset viewer.