Title: [239952] trunk/Source/WebCore
Revision
239952
Author
rn...@webkit.org
Date
2019-01-14 14:51:56 -0800 (Mon, 14 Jan 2019)

Log Message

Remove redundant check for alignAttr and hiddenAttr in various isPresentationAttribute overrides
https://bugs.webkit.org/show_bug.cgi?id=193410

Reviewed by Simon Fraser.

Removed redundant checks for check for alignAttr and hiddenAttr in isPresentationAttribute overrides
in HTMLElement subclasses since HTMLElement::isPresentationAttribute already checks for those attributes.

* html/HTMLDivElement.cpp:
(WebCore::HTMLDivElement::isPresentationAttribute const): Deleted.
* html/HTMLDivElement.h:
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::isPresentationAttribute const): Deleted.
* html/HTMLEmbedElement.h:
* html/HTMLHRElement.cpp:
(WebCore::HTMLHRElement::isPresentationAttribute const):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::isPresentationAttribute const):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::isPresentationAttribute const):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isPresentationAttribute const):
* html/HTMLParagraphElement.cpp:
(WebCore::HTMLParagraphElement::isPresentationAttribute const): Deleted.
* html/HTMLParagraphElement.h:
* html/HTMLTableCaptionElement.cpp:
(WebCore::HTMLTableCaptionElement::isPresentationAttribute const): Deleted.
* html/HTMLTableCaptionElement.h:
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::isPresentationAttribute const):
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::isPresentationAttribute const):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (239951 => 239952)


--- trunk/Source/WebCore/ChangeLog	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/ChangeLog	2019-01-14 22:51:56 UTC (rev 239952)
@@ -1,3 +1,38 @@
+2019-01-14  Ryosuke Niwa  <rn...@webkit.org>
+
+        Remove redundant check for alignAttr and hiddenAttr in various isPresentationAttribute overrides
+        https://bugs.webkit.org/show_bug.cgi?id=193410
+
+        Reviewed by Simon Fraser.
+
+        Removed redundant checks for check for alignAttr and hiddenAttr in isPresentationAttribute overrides
+        in HTMLElement subclasses since HTMLElement::isPresentationAttribute already checks for those attributes.
+
+        * html/HTMLDivElement.cpp:
+        (WebCore::HTMLDivElement::isPresentationAttribute const): Deleted.
+        * html/HTMLDivElement.h:
+        * html/HTMLEmbedElement.cpp:
+        (WebCore::HTMLEmbedElement::isPresentationAttribute const): Deleted.
+        * html/HTMLEmbedElement.h:
+        * html/HTMLHRElement.cpp:
+        (WebCore::HTMLHRElement::isPresentationAttribute const):
+        * html/HTMLIFrameElement.cpp:
+        (WebCore::HTMLIFrameElement::isPresentationAttribute const):
+        * html/HTMLImageElement.cpp:
+        (WebCore::HTMLImageElement::isPresentationAttribute const):
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::isPresentationAttribute const):
+        * html/HTMLParagraphElement.cpp:
+        (WebCore::HTMLParagraphElement::isPresentationAttribute const): Deleted.
+        * html/HTMLParagraphElement.h:
+        * html/HTMLTableCaptionElement.cpp:
+        (WebCore::HTMLTableCaptionElement::isPresentationAttribute const): Deleted.
+        * html/HTMLTableCaptionElement.h:
+        * html/HTMLTableElement.cpp:
+        (WebCore::HTMLTableElement::isPresentationAttribute const):
+        * html/HTMLTablePartElement.cpp:
+        (WebCore::HTMLTablePartElement::isPresentationAttribute const):
+
 2019-01-14  Commit Queue  <commit-qu...@webkit.org>
 
         Unreviewed, rolling out r239901, r239909, r239910, r239912,

Modified: trunk/Source/WebCore/html/HTMLDivElement.cpp (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLDivElement.cpp	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLDivElement.cpp	2019-01-14 22:51:56 UTC (rev 239952)
@@ -50,13 +50,6 @@
     return adoptRef(*new HTMLDivElement(tagName, document));
 }
 
-bool HTMLDivElement::isPresentationAttribute(const QualifiedName& name) const
-{
-    if (name == alignAttr)
-        return true;
-    return HTMLElement::isPresentationAttribute(name);
-}
-
 void HTMLDivElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStyleProperties& style)
 {
     if (name == alignAttr) {

Modified: trunk/Source/WebCore/html/HTMLDivElement.h (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLDivElement.h	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLDivElement.h	2019-01-14 22:51:56 UTC (rev 239952)
@@ -36,7 +36,6 @@
     HTMLDivElement(const QualifiedName&, Document&);
 
 private:
-    bool isPresentationAttribute(const QualifiedName&) const final;
     void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final;
 };
 

Modified: trunk/Source/WebCore/html/HTMLEmbedElement.cpp (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLEmbedElement.cpp	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLEmbedElement.cpp	2019-01-14 22:51:56 UTC (rev 239952)
@@ -90,13 +90,6 @@
     return findWidgetRenderer(this);
 }
 
-bool HTMLEmbedElement::isPresentationAttribute(const QualifiedName& name) const
-{
-    if (name == hiddenAttr)
-        return true;
-    return HTMLPlugInImageElement::isPresentationAttribute(name);
-}
-
 void HTMLEmbedElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStyleProperties& style)
 {
     if (name == hiddenAttr) {

Modified: trunk/Source/WebCore/html/HTMLEmbedElement.h (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLEmbedElement.h	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLEmbedElement.h	2019-01-14 22:51:56 UTC (rev 239952)
@@ -36,7 +36,6 @@
     HTMLEmbedElement(const QualifiedName&, Document&);
 
     void parseAttribute(const QualifiedName&, const AtomicString&) final;
-    bool isPresentationAttribute(const QualifiedName&) const final;
     void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final;
 
     bool rendererIsNeeded(const RenderStyle&) final;

Modified: trunk/Source/WebCore/html/HTMLHRElement.cpp (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLHRElement.cpp	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLHRElement.cpp	2019-01-14 22:51:56 UTC (rev 239952)
@@ -54,7 +54,7 @@
 
 bool HTMLHRElement::isPresentationAttribute(const QualifiedName& name) const
 {
-    if (name == alignAttr || name == widthAttr || name == colorAttr || name == noshadeAttr || name == sizeAttr)
+    if (name == widthAttr || name == colorAttr || name == noshadeAttr || name == sizeAttr)
         return true;
     return HTMLElement::isPresentationAttribute(name);
 }

Modified: trunk/Source/WebCore/html/HTMLIFrameElement.cpp (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLIFrameElement.cpp	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLIFrameElement.cpp	2019-01-14 22:51:56 UTC (rev 239952)
@@ -62,7 +62,7 @@
 
 bool HTMLIFrameElement::isPresentationAttribute(const QualifiedName& name) const
 {
-    if (name == widthAttr || name == heightAttr || name == alignAttr || name == frameborderAttr)
+    if (name == widthAttr || name == heightAttr || name == frameborderAttr)
         return true;
     return HTMLFrameElementBase::isPresentationAttribute(name);
 }

Modified: trunk/Source/WebCore/html/HTMLImageElement.cpp (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLImageElement.cpp	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLImageElement.cpp	2019-01-14 22:51:56 UTC (rev 239952)
@@ -114,7 +114,7 @@
 
 bool HTMLImageElement::isPresentationAttribute(const QualifiedName& name) const
 {
-    if (name == widthAttr || name == heightAttr || name == borderAttr || name == vspaceAttr || name == hspaceAttr || name == alignAttr || name == valignAttr)
+    if (name == widthAttr || name == heightAttr || name == borderAttr || name == vspaceAttr || name == hspaceAttr || name == valignAttr)
         return true;
     return HTMLElement::isPresentationAttribute(name);
 }

Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2019-01-14 22:51:56 UTC (rev 239952)
@@ -645,7 +645,7 @@
 
 bool HTMLInputElement::isPresentationAttribute(const QualifiedName& name) const
 {
-    if (name == vspaceAttr || name == hspaceAttr || name == alignAttr || name == widthAttr || name == heightAttr || (name == borderAttr && isImageButton()))
+    if (name == vspaceAttr || name == hspaceAttr || name == widthAttr || name == heightAttr || (name == borderAttr && isImageButton()))
         return true;
     return HTMLTextFormControlElement::isPresentationAttribute(name);
 }

Modified: trunk/Source/WebCore/html/HTMLParagraphElement.cpp (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLParagraphElement.cpp	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLParagraphElement.cpp	2019-01-14 22:51:56 UTC (rev 239952)
@@ -51,13 +51,6 @@
     return adoptRef(*new HTMLParagraphElement(tagName, document));
 }
 
-bool HTMLParagraphElement::isPresentationAttribute(const QualifiedName& name) const
-{
-    if (name == alignAttr)
-        return true;
-    return HTMLElement::isPresentationAttribute(name);
-}
-
 void HTMLParagraphElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStyleProperties& style)
 {
     if (name == alignAttr) {

Modified: trunk/Source/WebCore/html/HTMLParagraphElement.h (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLParagraphElement.h	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLParagraphElement.h	2019-01-14 22:51:56 UTC (rev 239952)
@@ -35,7 +35,6 @@
 private:
     HTMLParagraphElement(const QualifiedName&, Document&);
 
-    bool isPresentationAttribute(const QualifiedName&) const final;
     void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final;
 };
 

Modified: trunk/Source/WebCore/html/HTMLTableCaptionElement.cpp (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLTableCaptionElement.cpp	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLTableCaptionElement.cpp	2019-01-14 22:51:56 UTC (rev 239952)
@@ -46,13 +46,6 @@
     return adoptRef(*new HTMLTableCaptionElement(tagName, document));
 }
 
-bool HTMLTableCaptionElement::isPresentationAttribute(const QualifiedName& name) const
-{
-    if (name == alignAttr)
-        return true;
-    return HTMLElement::isPresentationAttribute(name);
-}
-
 void HTMLTableCaptionElement::collectStyleForPresentationAttribute(const QualifiedName& name, const AtomicString& value, MutableStyleProperties& style)
 {
     if (name == alignAttr) {

Modified: trunk/Source/WebCore/html/HTMLTableCaptionElement.h (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLTableCaptionElement.h	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLTableCaptionElement.h	2019-01-14 22:51:56 UTC (rev 239952)
@@ -37,7 +37,6 @@
 private:
     HTMLTableCaptionElement(const QualifiedName&, Document&);
 
-    bool isPresentationAttribute(const QualifiedName&) const final;
     void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) final;
 };
 

Modified: trunk/Source/WebCore/html/HTMLTableElement.cpp (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLTableElement.cpp	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLTableElement.cpp	2019-01-14 22:51:56 UTC (rev 239952)
@@ -363,7 +363,7 @@
 
 bool HTMLTableElement::isPresentationAttribute(const QualifiedName& name) const
 {
-    if (name == widthAttr || name == heightAttr || name == bgcolorAttr || name == backgroundAttr || name == valignAttr || name == vspaceAttr || name == hspaceAttr || name == alignAttr || name == cellspacingAttr || name == borderAttr || name == bordercolorAttr || name == frameAttr || name == rulesAttr)
+    if (name == widthAttr || name == heightAttr || name == bgcolorAttr || name == backgroundAttr || name == valignAttr || name == vspaceAttr || name == hspaceAttr || name == cellspacingAttr || name == borderAttr || name == bordercolorAttr || name == frameAttr || name == rulesAttr)
         return true;
     return HTMLElement::isPresentationAttribute(name);
 }

Modified: trunk/Source/WebCore/html/HTMLTablePartElement.cpp (239951 => 239952)


--- trunk/Source/WebCore/html/HTMLTablePartElement.cpp	2019-01-14 22:31:06 UTC (rev 239951)
+++ trunk/Source/WebCore/html/HTMLTablePartElement.cpp	2019-01-14 22:51:56 UTC (rev 239952)
@@ -43,7 +43,7 @@
 
 bool HTMLTablePartElement::isPresentationAttribute(const QualifiedName& name) const
 {
-    if (name == bgcolorAttr || name == backgroundAttr || name == valignAttr || name == alignAttr || name == heightAttr)
+    if (name == bgcolorAttr || name == backgroundAttr || name == valignAttr || name == heightAttr)
         return true;
     return HTMLElement::isPresentationAttribute(name);
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to