Title: [152743] trunk/Source/WebCore
- Revision
- 152743
- Author
- [email protected]
- Date
- 2013-07-16 15:03:18 -0700 (Tue, 16 Jul 2013)
Log Message
Atomicize HTMLAnchorElement.hash before passing it to JS.
<http://webkit.org/b/118748>
<rdar://problem/14459780>
Reviewed by Sam Weinig.
Instead of generating a unique string from '#' + the URL hash every time HTMLAnchorElement.hash
is queried, turn it into an AtomicString. This prevents massive memory usage in scripts that
fetch .hash a lot.
Reduces memory consumption by 4.65 MB when viewing the full HTML5 spec at <http://whatwg.org/c>
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::hash):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (152742 => 152743)
--- trunk/Source/WebCore/ChangeLog 2013-07-16 21:41:06 UTC (rev 152742)
+++ trunk/Source/WebCore/ChangeLog 2013-07-16 22:03:18 UTC (rev 152743)
@@ -1,3 +1,20 @@
+2013-07-16 Andreas Kling <[email protected]>
+
+ Atomicize HTMLAnchorElement.hash before passing it to JS.
+ <http://webkit.org/b/118748>
+ <rdar://problem/14459780>
+
+ Reviewed by Sam Weinig.
+
+ Instead of generating a unique string from '#' + the URL hash every time HTMLAnchorElement.hash
+ is queried, turn it into an AtomicString. This prevents massive memory usage in scripts that
+ fetch .hash a lot.
+
+ Reduces memory consumption by 4.65 MB when viewing the full HTML5 spec at <http://whatwg.org/c>
+
+ * html/HTMLAnchorElement.cpp:
+ (WebCore::HTMLAnchorElement::hash):
+
2013-07-16 Brendan Long <[email protected]>
Make WebVTTParser return cue data instead of cue DOM objects
Modified: trunk/Source/WebCore/html/HTMLAnchorElement.cpp (152742 => 152743)
--- trunk/Source/WebCore/html/HTMLAnchorElement.cpp 2013-07-16 21:41:06 UTC (rev 152742)
+++ trunk/Source/WebCore/html/HTMLAnchorElement.cpp 2013-07-16 22:03:18 UTC (rev 152743)
@@ -336,7 +336,9 @@
String HTMLAnchorElement::hash() const
{
String fragmentIdentifier = href().fragmentIdentifier();
- return fragmentIdentifier.isEmpty() ? emptyString() : "#" + fragmentIdentifier;
+ if (fragmentIdentifier.isEmpty())
+ return emptyString();
+ return AtomicString(String("#" + fragmentIdentifier));
}
void HTMLAnchorElement::setHash(const String& value)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes