Title: [173800] trunk/Source/WebCore
Revision
173800
Author
[email protected]
Date
2014-09-21 17:18:50 -0700 (Sun, 21 Sep 2014)

Log Message

Fix post-mortem nits for r173724
https://bugs.webkit.org/show_bug.cgi?id=136986

Reviewed by Darin Adler.

Fix post-mortem nits for r173724.

No new tests, no behavior change.

* editing/EditingStyle.cpp:
(WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue):
(WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue):
Use nullptr instead of 0.

* editing/SplitElementCommand.cpp:
(WebCore::SplitElementCommand::doUnapply):
Use getIdAttribute() / setIdAttribute().

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computePreferredLogicalWidths):
Use fastHasAttribute() for nowrap and do an early return to avoid
calling styleOrColLogicalWidth() if the nowrap attribute is missing.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (173799 => 173800)


--- trunk/Source/WebCore/ChangeLog	2014-09-21 23:52:31 UTC (rev 173799)
+++ trunk/Source/WebCore/ChangeLog	2014-09-22 00:18:50 UTC (rev 173800)
@@ -1,3 +1,28 @@
+2014-09-21  Christophe Dumez  <[email protected]>
+
+        Fix post-mortem nits for r173724
+        https://bugs.webkit.org/show_bug.cgi?id=136986
+
+        Reviewed by Darin Adler.
+
+        Fix post-mortem nits for r173724.
+
+        No new tests, no behavior change.
+
+        * editing/EditingStyle.cpp:
+        (WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue):
+        (WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue):
+        Use nullptr instead of 0.
+
+        * editing/SplitElementCommand.cpp:
+        (WebCore::SplitElementCommand::doUnapply):
+        Use getIdAttribute() / setIdAttribute().
+
+        * rendering/RenderTableCell.cpp:
+        (WebCore::RenderTableCell::computePreferredLogicalWidths):
+        Use fastHasAttribute() for nowrap and do an early return to avoid
+        calling styleOrColLogicalWidth() if the nowrap attribute is missing.
+
 2014-09-21  Filip Pizlo  <[email protected]>
 
         Unreviewed, speculative build fix.

Modified: trunk/Source/WebCore/editing/EditingStyle.cpp (173799 => 173800)


--- trunk/Source/WebCore/editing/EditingStyle.cpp	2014-09-21 23:52:31 UTC (rev 173799)
+++ trunk/Source/WebCore/editing/EditingStyle.cpp	2014-09-22 00:18:50 UTC (rev 173800)
@@ -279,7 +279,7 @@
     ASSERT(element);
     const AtomicString& value = element->getAttribute(m_attrName);
     if (value.isNull())
-        return 0;
+        return nullptr;
     
     RefPtr<MutableStyleProperties> dummyStyle;
     dummyStyle = MutableStyleProperties::create();
@@ -304,10 +304,10 @@
     ASSERT(element);
     const AtomicString& value = element->getAttribute(m_attrName);
     if (value.isNull())
-        return 0;
+        return nullptr;
     CSSValueID size;
     if (!HTMLFontElement::cssValueFromFontSizeNumber(value, size))
-        return 0;
+        return nullptr;
     return CSSPrimitiveValue::createIdentifier(size);
 }
 

Modified: trunk/Source/WebCore/editing/SplitElementCommand.cpp (173799 => 173800)


--- trunk/Source/WebCore/editing/SplitElementCommand.cpp	2014-09-21 23:52:31 UTC (rev 173799)
+++ trunk/Source/WebCore/editing/SplitElementCommand.cpp	2014-09-22 00:18:50 UTC (rev 173800)
@@ -91,9 +91,9 @@
         m_element2->insertBefore(children[i].get(), refChild.get(), IGNORE_EXCEPTION);
 
     // Recover the id attribute of the original element.
-    const AtomicString& id = m_element1->fastGetAttribute(HTMLNames::idAttr);
+    const AtomicString& id = m_element1->getIdAttribute();
     if (!id.isNull())
-        m_element2->setAttribute(HTMLNames::idAttr, id);
+        m_element2->setIdAttribute(id);
 
     m_element1->remove(IGNORE_EXCEPTION);
 }

Modified: trunk/Source/WebCore/rendering/RenderTableCell.cpp (173799 => 173800)


--- trunk/Source/WebCore/rendering/RenderTableCell.cpp	2014-09-21 23:52:31 UTC (rev 173799)
+++ trunk/Source/WebCore/rendering/RenderTableCell.cpp	2014-09-22 00:18:50 UTC (rev 173800)
@@ -175,17 +175,17 @@
     table()->recalcSectionsIfNeeded();
 
     RenderBlockFlow::computePreferredLogicalWidths();
-    if (element() && style().autoWrap()) {
-        // See if nowrap was set.
-        Length w = styleOrColLogicalWidth();
-        const AtomicString& nowrap = element()->fastGetAttribute(nowrapAttr);
-        if (!nowrap.isNull() && w.isFixed())
-            // Nowrap is set, but we didn't actually use it because of the
-            // fixed width set on the cell.  Even so, it is a WinIE/Moz trait
-            // to make the minwidth of the cell into the fixed width.  They do this
-            // even in strict mode, so do not make this a quirk.  Affected the top
-            // of hiptop.com.
-            m_minPreferredLogicalWidth = std::max<LayoutUnit>(w.value(), m_minPreferredLogicalWidth);
+    if (!element() || !style().autoWrap() || !element()->fastHasAttribute(nowrapAttr))
+        return;
+
+    Length w = styleOrColLogicalWidth();
+    if (w.isFixed()) {
+        // Nowrap is set, but we didn't actually use it because of the
+        // fixed width set on the cell. Even so, it is a WinIE/Moz trait
+        // to make the minwidth of the cell into the fixed width. They do this
+        // even in strict mode, so do not make this a quirk. Affected the top
+        // of hiptop.com.
+        m_minPreferredLogicalWidth = std::max<LayoutUnit>(w.value(), m_minPreferredLogicalWidth);
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to