Title: [287521] trunk/Source/WebCore
Revision
287521
Author
wenson_hs...@apple.com
Date
2022-01-02 11:05:11 -0800 (Sun, 02 Jan 2022)

Log Message

Followup to r287494
https://bugs.webkit.org/show_bug.cgi?id=234747
rdar://85899879

Reviewed by Darin Adler.

Use `auto` instread of `RefPtr` when storing the result of `enclosingImageElement()` in a few places; this
method already returns a `RefPtr`.

* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::updateAttributes):
(WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (287520 => 287521)


--- trunk/Source/WebCore/ChangeLog	2022-01-02 18:48:04 UTC (rev 287520)
+++ trunk/Source/WebCore/ChangeLog	2022-01-02 19:05:11 UTC (rev 287521)
@@ -1,3 +1,18 @@
+2022-01-02  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        Followup to r287494
+        https://bugs.webkit.org/show_bug.cgi?id=234747
+        rdar://85899879
+
+        Reviewed by Darin Adler.
+
+        Use `auto` instread of `RefPtr` when storing the result of `enclosingImageElement()` in a few places; this
+        method already returns a `RefPtr`.
+
+        * html/HTMLAttachmentElement.cpp:
+        (WebCore::HTMLAttachmentElement::updateAttributes):
+        (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
+
 2022-01-02  Antti Koivisto  <an...@apple.com>
 
         [LFC][Integration] RenderBlockFlow::containsNonZeroBidiLevel should use iterator

Modified: trunk/Source/WebCore/html/HTMLAttachmentElement.cpp (287520 => 287521)


--- trunk/Source/WebCore/html/HTMLAttachmentElement.cpp	2022-01-02 18:48:04 UTC (rev 287520)
+++ trunk/Source/WebCore/html/HTMLAttachmentElement.cpp	2022-01-02 19:05:11 UTC (rev 287521)
@@ -207,11 +207,11 @@
 void HTMLAttachmentElement::updateAttributes(std::optional<uint64_t>&& newFileSize, const String& newContentType, const String& newFilename)
 {
     if (!newFilename.isNull()) {
-        if (RefPtr enclosingImage = enclosingImageElement())
+        if (auto enclosingImage = enclosingImageElement())
             enclosingImage->setAttributeWithoutSynchronization(HTMLNames::altAttr, newFilename);
         setAttributeWithoutSynchronization(HTMLNames::titleAttr, newFilename);
     } else {
-        if (RefPtr enclosingImage = enclosingImageElement())
+        if (auto enclosingImage = enclosingImageElement())
             enclosingImage->removeAttribute(HTMLNames::altAttr);
         removeAttribute(HTMLNames::titleAttr);
     }
@@ -240,7 +240,7 @@
     if (buffer->isEmpty())
         return;
 
-    RefPtr enclosingImage = enclosingImageElement();
+    auto enclosingImage = enclosingImageElement();
     if (!enclosingImage)
         return;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to