<rdar://problem/
3628309>: Fedex tracking page so slow it seems like a hang (site change?)
<rdar://problem/
3608061>: "ATI Developer site so slow it seems like a hang"
<rdar://problem/
3612130>: "Reproducible hang in JavaScript at www.tfl.gov.uk"
<rdar://problem/
3626022>: "Safari was consuming > 100% CPU on dual-G5 Mac, sample shows JavaScript"
<rdar://problem/
3632348>: "www.whatis.com search for "pivot table" leads to JavaScript hang"
* khtml/ecma/kjs_html.cpp:
(KJS::HTMLElement::getValueProperty): The "text" property for anchors should be
innerText, not innerHTML.
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::innerText): Make sure not to include all the text after an
element if it has no children.
* layout-tests/fast/dom/anchor-text-expected.txt: Added.
* layout-tests/fast/dom/anchor-text.html: Added.
* layout-tests/fast/dom/inner-text-expected.txt: Added.
* layout-tests/fast/dom/inner-text.html: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@6480
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x34
+ RenderBlock {HTML} at (0,0) size 800x34
+ RenderBody {BODY} at (8,8) size 784x18
+ RenderInline {A} at (0,0) size 236x18 [color=#0000EE]
+ RenderInline {B} at (0,0) size 236x18
+ RenderText {TEXT} at (0,0) size 236x18
+ text run at (0,0) width 236: "the second copy should not be bold"
+ RenderText {TEXT} at (236,0) size 4x18
+ text run at (236,0) width 4: " "
+ RenderInline {B} at (0,0) size 236x18
+ RenderText {TEXT} at (240,0) size 236x18
+ text run at (240,0) width 236: "the second copy should not be bold"
--- /dev/null
+<a id="x" href="http://www.google.com"><b>the second copy should not be bold</b></a>
+<script>
+document.write(document.getElementById("x").text);
+</script>
\ No newline at end of file
--- /dev/null
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x62
+ RenderBlock {HTML} at (0,0) size 800x62
+ RenderBody {BODY} at (8,8) size 784x46
+ RenderImage {IMG} at (0,0) size 24x24
+ RenderText {TEXT} at (24,10) size 225x18
+ text run at (24,10) width 225: " This text should only appear once. "
+ RenderText {TEXT} at (249,10) size 466x36
+ text run at (249,10) width 217: "This text should only appear once."
+ text run at (0,28) width 378: "document.write(document.getElementById(\"x\").innerText);"
--- /dev/null
+<img id="x" src="broken.gif">
+This text should only appear once.
+<script>
+document.write(document.getElementById("x").innerText);
+</script>
+2004-04-25 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Darin.
+
+ <rdar://problem/3628309>: Fedex tracking page so slow it seems like a hang (site change?)
+ <rdar://problem/3608061>: "ATI Developer site so slow it seems like a hang"
+ <rdar://problem/3612130>: "Reproducible hang in JavaScript at www.tfl.gov.uk"
+ <rdar://problem/3626022>: "Safari was consuming > 100% CPU on dual-G5 Mac, sample shows JavaScript"
+ <rdar://problem/3632348>: "www.whatis.com search for "pivot table" leads to JavaScript hang"
+
+ * khtml/ecma/kjs_html.cpp:
+ (KJS::HTMLElement::getValueProperty): The "text" property for anchors should be
+ innerText, not innerHTML.
+ * khtml/html/html_elementimpl.cpp:
+ (HTMLElementImpl::innerText): Make sure not to include all the text after an
+ element if it has no children.
+ * layout-tests/fast/dom/anchor-text-expected.txt: Added.
+ * layout-tests/fast/dom/anchor-text.html: Added.
+ * layout-tests/fast/dom/inner-text-expected.txt: Added.
+ * layout-tests/fast/dom/inner-text.html: Added.
+
2004-04-24 Darin Adler <darin@apple.com>
Reviewed by Dave.
case AnchorShape: return String(anchor.shape());
case AnchorTabIndex: return Number(anchor.tabIndex());
case AnchorTarget: return String(anchor.target());
- case AnchorText: return String(anchor.innerHTML());
+ case AnchorText: return String(anchor.innerText());
case AnchorType: return String(anchor.type());
}
}
{
DOMString text;
- const NodeImpl *n = this;
+ const NodeImpl *n = firstChild();
// find the next text/image after the anchor, to get a position
while(n) {
+ if(n->isTextNode() ) {
+ text += static_cast<const TextImpl *>(n)->data();
+ }
if(n->firstChild())
n = n->firstChild();
else if(n->nextSibling())
}
n = next;
}
- if(n->isTextNode() ) {
- text += static_cast<const TextImpl *>(n)->data();
- }
}
end:
return text;