Title: [287461] trunk/Source/WebCore
Revision
287461
Author
wenson_hs...@apple.com
Date
2021-12-27 16:29:08 -0800 (Mon, 27 Dec 2021)

Log Message

Element::boundingAbsoluteRectWithoutLayout() should be marked `const`
https://bugs.webkit.org/show_bug.cgi?id=234703

Reviewed by Darin Adler.

Mark an existing method on Element as `const`, so that it can be invoked with `const Element*`/`const Element&`.
No change in behavior.

* dom/Element.cpp:
(WebCore::listBoxElementBoundingBox):
(WebCore::Element::boundingAbsoluteRectWithoutLayout const):
(WebCore::Element::boundingAbsoluteRectWithoutLayout): Deleted.
* dom/Element.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287460 => 287461)


--- trunk/Source/WebCore/ChangeLog	2021-12-27 16:39:32 UTC (rev 287460)
+++ trunk/Source/WebCore/ChangeLog	2021-12-28 00:29:08 UTC (rev 287461)
@@ -1,3 +1,19 @@
+2021-12-27  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Element::boundingAbsoluteRectWithoutLayout() should be marked `const`
+        https://bugs.webkit.org/show_bug.cgi?id=234703
+
+        Reviewed by Darin Adler.
+
+        Mark an existing method on Element as `const`, so that it can be invoked with `const Element*`/`const Element&`.
+        No change in behavior.
+
+        * dom/Element.cpp:
+        (WebCore::listBoxElementBoundingBox):
+        (WebCore::Element::boundingAbsoluteRectWithoutLayout const):
+        (WebCore::Element::boundingAbsoluteRectWithoutLayout): Deleted.
+        * dom/Element.h:
+
 2021-12-26  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [GTK][a11y] Test accessibility/aria-inherits-presentational.html is failing with ATSPI

Modified: trunk/Source/WebCore/dom/Element.cpp (287460 => 287461)


--- trunk/Source/WebCore/dom/Element.cpp	2021-12-27 16:39:32 UTC (rev 287460)
+++ trunk/Source/WebCore/dom/Element.cpp	2021-12-28 00:29:08 UTC (rev 287461)
@@ -1678,7 +1678,7 @@
     return absoluteEventBoundsOfElementAndDescendants(includesFixedPositionElements);
 }
 
-static std::optional<std::pair<RenderObject*, LayoutRect>> listBoxElementBoundingBox(Element& element)
+static std::optional<std::pair<RenderObject*, LayoutRect>> listBoxElementBoundingBox(const Element& element)
 {
     HTMLSelectElement* selectElement;
     bool isGroup;
@@ -1742,14 +1742,13 @@
     return DOMRectList::create(quads);
 }
 
-std::optional<std::pair<RenderObject*, FloatRect>> Element::boundingAbsoluteRectWithoutLayout()
+std::optional<std::pair<RenderObject*, FloatRect>> Element::boundingAbsoluteRectWithoutLayout() const
 {
     RenderObject* renderer = this->renderer();
     Vector<FloatQuad> quads;
     if (isSVGElement() && renderer && !renderer->isSVGRootOrLegacySVGRoot()) {
         // Get the bounding rectangle from the SVG model.
-        SVGElement& svgElement = downcast<SVGElement>(*this);
-        if (auto localRect = svgElement.getBoundingBox())
+        if (auto localRect = downcast<SVGElement>(*this).getBoundingBox())
             quads.append(renderer->localToAbsoluteQuad(*localRect));
     } else if (auto pair = listBoxElementBoundingBox(*this)) {
         renderer = pair.value().first;

Modified: trunk/Source/WebCore/dom/Element.h (287460 => 287461)


--- trunk/Source/WebCore/dom/Element.h	2021-12-27 16:39:32 UTC (rev 287460)
+++ trunk/Source/WebCore/dom/Element.h	2021-12-28 00:29:08 UTC (rev 287461)
@@ -213,7 +213,7 @@
     // This does not update layout, and uses absoluteBoundingBoxRect().
     WEBCORE_EXPORT IntRect boundingBoxInRootViewCoordinates() const;
 
-    std::optional<std::pair<RenderObject*, FloatRect>> boundingAbsoluteRectWithoutLayout();
+    std::optional<std::pair<RenderObject*, FloatRect>> boundingAbsoluteRectWithoutLayout() const;
 
     WEBCORE_EXPORT FloatRect boundingClientRect();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to