Title: [140383] trunk/Source/WebCore
Revision
140383
Author
[email protected]
Date
2013-01-21 22:02:03 -0800 (Mon, 21 Jan 2013)

Log Message

CSSSelector::value() should assert that m_match != Tag.
<http://webkit.org/b/107500>

Reviewed by Anders Carlsson.

Add an assertion to catch anyone trying to extract a value() from a Tag selector.

* css/CSSSelector.h:
(CSSSelector):
(WebCore::CSSSelector::value):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (140382 => 140383)


--- trunk/Source/WebCore/ChangeLog	2013-01-22 05:07:16 UTC (rev 140382)
+++ trunk/Source/WebCore/ChangeLog	2013-01-22 06:02:03 UTC (rev 140383)
@@ -1,3 +1,16 @@
+2013-01-21  Andreas Kling  <[email protected]>
+
+        CSSSelector::value() should assert that m_match != Tag.
+        <http://webkit.org/b/107500>
+
+        Reviewed by Anders Carlsson.
+
+        Add an assertion to catch anyone trying to extract a value() from a Tag selector.
+
+        * css/CSSSelector.h:
+        (CSSSelector):
+        (WebCore::CSSSelector::value):
+
 2013-01-21  Dimitri Glazkov  <[email protected]>
 
         Move HTML Attribute case-sensitivity logic out of SelectorChecker to HTMLDocument.

Modified: trunk/Source/WebCore/css/CSSSelector.h (140382 => 140383)


--- trunk/Source/WebCore/css/CSSSelector.h	2013-01-22 05:07:16 UTC (rev 140382)
+++ trunk/Source/WebCore/css/CSSSelector.h	2013-01-22 06:02:03 UTC (rev 140383)
@@ -201,9 +201,7 @@
         CSSSelector* tagHistory() const { return m_isLastInTagHistory ? 0 : const_cast<CSSSelector*>(this + 1); }
 
         const QualifiedName& tagQName() const;
-        // AtomicString is really just an AtomicStringImpl* so the cast below is safe.
-        // FIXME: Perhaps call sites could be changed to accept AtomicStringImpl?
-        const AtomicString& value() const { return *reinterpret_cast<const AtomicString*>(m_hasRareData ? &m_data.m_rareData->m_value : &m_data.m_value); }
+        const AtomicString& value() const;
         const QualifiedName& attribute() const;
         const AtomicString& argument() const { return m_hasRareData ? m_data.m_rareData->m_argument : nullAtom; }
         CSSSelectorList* selectorList() const { return m_hasRareData ? m_data.m_rareData->m_selectorList.get() : 0; }
@@ -425,6 +423,15 @@
     return *reinterpret_cast<const QualifiedName*>(&m_data.m_tagQName);
 }
 
+inline const AtomicString& CSSSelector::value() const
+{
+    ASSERT(m_match != Tag);
+    // AtomicString is really just an AtomicStringImpl* so the cast below is safe.
+    // FIXME: Perhaps call sites could be changed to accept AtomicStringImpl?
+    return *reinterpret_cast<const AtomicString*>(m_hasRareData ? &m_data.m_rareData->m_value : &m_data.m_value);
+}
+
+
 } // namespace WebCore
 
 #endif // CSSSelector_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to