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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp

Issue 2343673003: SVG root viewport clip in paint property tree (Closed)
Patch Set: - Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/PaintPropertyTreeBuilder.h" 5 #include "core/paint/PaintPropertyTreeBuilder.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 return; 336 return;
337 const LayoutBox& box = toLayoutBox(object); 337 const LayoutBox& box = toLayoutBox(object);
338 338
339 // The <input> elements can't have contents thus CSS overflow property doesn 't apply. 339 // The <input> elements can't have contents thus CSS overflow property doesn 't apply.
340 // However for layout purposes we do generate child layout objects for them, e.g. button label. 340 // However for layout purposes we do generate child layout objects for them, e.g. button label.
341 // We should clip the overflow from those children. This is called control c lip and we 341 // We should clip the overflow from those children. This is called control c lip and we
342 // technically treat them like overflow clip. 342 // technically treat them like overflow clip.
343 LayoutRect clipRect; 343 LayoutRect clipRect;
344 if (box.hasControlClip()) { 344 if (box.hasControlClip()) {
345 clipRect = box.controlClipRect(context.current.paintOffset); 345 clipRect = box.controlClipRect(context.current.paintOffset);
346 } else if (box.hasOverflowClip()) { 346 } else if (box.hasOverflowClip() || (box.isSVGRoot() && toLayoutSVGRoot(box) .shouldApplyViewportClip())) {
347 clipRect = box.overflowClipRect(context.current.paintOffset); 347 clipRect = box.overflowClipRect(context.current.paintOffset);
348 } else { 348 } else {
349 if (ObjectPaintProperties* properties = object.getMutableForPainting().o bjectPaintProperties()) 349 if (ObjectPaintProperties* properties = object.getMutableForPainting().o bjectPaintProperties())
350 properties->clearOverflowClip(); 350 properties->clearOverflowClip();
351 return; 351 return;
352 } 352 }
353 353
354 // This need to be in top-level block to hold the reference until we finish creating the normal clip node. 354 // This need to be in top-level block to hold the reference until we finish creating the normal clip node.
355 RefPtr<ClipPaintPropertyNode> borderRadiusClip; 355 RefPtr<ClipPaintPropertyNode> borderRadiusClip;
356 if (box.styleRef().hasBorderRadius()) { 356 if (box.styleRef().hasBorderRadius()) {
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 return; 555 return;
556 556
557 updateOverflowClip(object, context); 557 updateOverflowClip(object, context);
558 updatePerspective(object, context); 558 updatePerspective(object, context);
559 updateSvgLocalToBorderBoxTransform(object, context); 559 updateSvgLocalToBorderBoxTransform(object, context);
560 updateScrollAndScrollTranslation(object, context); 560 updateScrollAndScrollTranslation(object, context);
561 updateOutOfFlowContext(object, context); 561 updateOutOfFlowContext(object, context);
562 } 562 }
563 563
564 } // namespace blink 564 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698