Title: [122163] trunk/Source/WebCore
- Revision
- 122163
- Author
- [email protected]
- Date
- 2012-07-09 16:07:09 -0700 (Mon, 09 Jul 2012)
Log Message
Microdata tests are flaky
https://bugs.webkit.org/show_bug.cgi?id=90830
Reviewed by Antti Koivisto.
The bug was caused by SpaceSplitString's not copying on write properly.
Even if there was exactly one owner of the SpaceSplitString, we should still not modify
m_data since m_data is associated with a particular m_keyString in sharedDataMap().
The only situation in which we can safely modify m_data is when m_data's m_keyString is null
meaning that it had been unique'ed. Furthermore, this optimization had not been used for
class lists because class list's refCount is always zero as its ref and deref are forwarded
to the associated Element's ref and deref. This fix re-enables the optimization for class lists.
This behavior change is tested by existing microdata API tests. Without this patch,
some tests such as properties-collection-add-remove-property.html fail on the first run
when several tests were ran in the same WebKit instance.
* dom/SpaceSplitString.h:
(WebCore::SpaceSplitStringData::isUnique):
(WebCore::SpaceSplitString::ensureUnique):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (122162 => 122163)
--- trunk/Source/WebCore/ChangeLog 2012-07-09 23:05:17 UTC (rev 122162)
+++ trunk/Source/WebCore/ChangeLog 2012-07-09 23:07:09 UTC (rev 122163)
@@ -1,3 +1,27 @@
+2012-07-09 Ryosuke Niwa <[email protected]>
+
+ Microdata tests are flaky
+ https://bugs.webkit.org/show_bug.cgi?id=90830
+
+ Reviewed by Antti Koivisto.
+
+ The bug was caused by SpaceSplitString's not copying on write properly.
+ Even if there was exactly one owner of the SpaceSplitString, we should still not modify
+ m_data since m_data is associated with a particular m_keyString in sharedDataMap().
+
+ The only situation in which we can safely modify m_data is when m_data's m_keyString is null
+ meaning that it had been unique'ed. Furthermore, this optimization had not been used for
+ class lists because class list's refCount is always zero as its ref and deref are forwarded
+ to the associated Element's ref and deref. This fix re-enables the optimization for class lists.
+
+ This behavior change is tested by existing microdata API tests. Without this patch,
+ some tests such as properties-collection-add-remove-property.html fail on the first run
+ when several tests were ran in the same WebKit instance.
+
+ * dom/SpaceSplitString.h:
+ (WebCore::SpaceSplitStringData::isUnique):
+ (WebCore::SpaceSplitString::ensureUnique):
+
2012-07-09 Dana Jansens <[email protected]>
[chromium] Decouple RenderPass drawing from CCRenderSurface
Modified: trunk/Source/WebCore/dom/SpaceSplitString.h (122162 => 122163)
--- trunk/Source/WebCore/dom/SpaceSplitString.h 2012-07-09 23:05:17 UTC (rev 122162)
+++ trunk/Source/WebCore/dom/SpaceSplitString.h 2012-07-09 23:07:09 UTC (rev 122163)
@@ -49,6 +49,7 @@
void add(const AtomicString&);
void remove(const AtomicString&);
+ bool isUnique() const { return m_keyString.isNull(); }
size_t size() const { return m_vector.size(); }
const AtomicString& operator[](size_t i) { ASSERT(i < size()); return m_vector[i]; }
@@ -82,7 +83,7 @@
private:
void ensureUnique()
{
- if (m_data && !m_data->hasOneRef())
+ if (m_data && !m_data->isUnique())
m_data = SpaceSplitStringData::createUnique(*m_data);
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes