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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 2514573003: Update documentation and cleanup impls for localToSVGParentTransform() (Closed)
Patch Set: - Created 4 years, 1 month 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 // This is used for all computation of objectBoundingBox relative units and by 661 // This is used for all computation of objectBoundingBox relative units and by
662 // SVGLocatable::getBBox(). 662 // SVGLocatable::getBBox().
663 // NOTE: Markers are not specifically ignored here by SVG 1.1 spec, but we 663 // NOTE: Markers are not specifically ignored here by SVG 1.1 spec, but we
664 // ignore them since stroke-width is ignored (and marker size can depend on 664 // ignore them since stroke-width is ignored (and marker size can depend on
665 // stroke-width). objectBoundingBox is returned local coordinates. 665 // stroke-width). objectBoundingBox is returned local coordinates.
666 // The name objectBoundingBox is taken from the SVG 1.1 spec. 666 // The name objectBoundingBox is taken from the SVG 1.1 spec.
667 virtual FloatRect objectBoundingBox() const; 667 virtual FloatRect objectBoundingBox() const;
668 virtual FloatRect strokeBoundingBox() const; 668 virtual FloatRect strokeBoundingBox() const;
669 669
670 // Returns the smallest rectangle enclosing all of the painted content 670 // Returns the smallest rectangle enclosing all of the painted content
671 // respecting clipping, masking, filters, opacity, stroke-width and markers 671 // respecting clipping, masking, filters, opacity, stroke-width and markers.
672 // For most SVG objects, the local SVG coordinate space is the space where
673 // localSVGTransform applies. For SVG objects defining viewports (e.g.
674 // LayoutSVGForeignObject, LayoutSVGViewportContainer,
675 // LayoutSVGResourceMarker), the local SVG coordinate space is the viewport
676 // space.
672 virtual FloatRect visualRectInLocalSVGCoordinates() const; 677 virtual FloatRect visualRectInLocalSVGCoordinates() const;
673 678
674 // This only returns the transform="" value from the SVG element. 679 // This returns the transform applying to the local SVG coordinate space,
675 // Most callsites want localToParentTransform() instead. 680 // which combines the transform attribute value or CSS transform properties,
681 // and animation motion transform.
682 // See SVGGraphicsElement::calculateAnimatedLocalTransform().
683 // Most callsites want localToSVGParentTransform() instead.
676 virtual AffineTransform localSVGTransform() const; 684 virtual AffineTransform localSVGTransform() const;
677 685
678 // Returns the full transform mapping from local coordinates to local coords 686 // Returns the full transform mapping from local coordinates to parent's local
679 // for the parent SVG layoutObject 687 // coordinates. For most SVG objects, this is the same as localSVGTransform.
680 // This includes any viewport transforms and x/y offsets as well as the 688 // For SVG objects defining viewports (see visualRectInLocalSVGCoordinates),
681 // transform="" value off the element. 689 // this includes any viewport transforms and x/y offsets as well as
682 virtual const AffineTransform& localToSVGParentTransform() const; 690 // localSVGTransform.
691 virtual AffineTransform localToSVGParentTransform() const {
692 return localSVGTransform();
693 }
683 694
684 // SVG uses FloatPoint precise hit testing, and passes the point in parent 695 // SVG uses FloatPoint precise hit testing, and passes the point in parent
685 // coordinates instead of in paint invalidation container coordinates. 696 // coordinates instead of in paint invalidation container coordinates.
686 // Eventually the rest of the layout tree will move to a similar model. 697 // Eventually the rest of the layout tree will move to a similar model.
687 virtual bool nodeAtFloatPoint(HitTestResult&, 698 virtual bool nodeAtFloatPoint(HitTestResult&,
688 const FloatPoint& pointInParent, 699 const FloatPoint& pointInParent,
689 HitTestAction); 700 HitTestAction);
690 701
691 // End of SVG-specific methods. 702 // End of SVG-specific methods.
692 703
(...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after
2627 CORE_EXPORT void showLineTree(const blink::LayoutObject*); 2638 CORE_EXPORT void showLineTree(const blink::LayoutObject*);
2628 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); 2639 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1);
2629 // We don't make object2 an optional parameter so that showLayoutTree 2640 // We don't make object2 an optional parameter so that showLayoutTree
2630 // can be called from gdb easily. 2641 // can be called from gdb easily.
2631 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, 2642 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1,
2632 const blink::LayoutObject* object2); 2643 const blink::LayoutObject* object2);
2633 2644
2634 #endif 2645 #endif
2635 2646
2636 #endif // LayoutObject_h 2647 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698