[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.2.3-2-25-gb2c19be
Gustavo Noronha Silva
gns at gnome.org
Mon Sep 6 13:09:36 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit 1f1d325dd6cc69e48760fc06b8d0ea7d193fdecd
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jun 29 17:42:40 2010 +0000
<rdar://problem/7975842> Certain text is repeated after using splitText()
Reviewed by Darin Adler.
WebCore:
Tests: fast/text/setData-dirty-lines.html
fast/text/splitText-dirty-lines.html
* dom/CharacterData.cpp:
(WebCore::CharacterData::setData): Call RenderText::setTextWithOffset() rather than
setText(), because only the former correctly dirties line boxes.
* dom/Text.cpp:
(WebCore::Text::splitText): Ditto.
LayoutTests:
* fast/text/setData-dirty-lines-expected.checksum: Added.
* fast/text/setData-dirty-lines-expected.png: Added.
* fast/text/setData-dirty-lines-expected.txt: Added.
* fast/text/setData-dirty-lines.html: Added.
* fast/text/splitText-dirty-lines-expected.checksum: Added.
* fast/text/splitText-dirty-lines-expected.png: Added.
* fast/text/splitText-dirty-lines-expected.txt: Added.
* fast/text/splitText-dirty-lines.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@62134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index fbe08eb..fc487a0 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-06-29 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/7975842> Certain text is repeated after using splitText()
+
+ * fast/text/setData-dirty-lines-expected.checksum: Added.
+ * fast/text/setData-dirty-lines-expected.png: Added.
+ * fast/text/setData-dirty-lines-expected.txt: Added.
+ * fast/text/setData-dirty-lines.html: Added.
+ * fast/text/splitText-dirty-lines-expected.checksum: Added.
+ * fast/text/splitText-dirty-lines-expected.png: Added.
+ * fast/text/splitText-dirty-lines-expected.txt: Added.
+ * fast/text/splitText-dirty-lines.html: Added.
+
2010-06-25 Dan Bernstein <mitz at apple.com>
Reviewed by Sam Weinig.
diff --git a/LayoutTests/fast/text/setData-dirty-lines-expected.checksum b/LayoutTests/fast/text/setData-dirty-lines-expected.checksum
new file mode 100644
index 0000000..fccb871
--- /dev/null
+++ b/LayoutTests/fast/text/setData-dirty-lines-expected.checksum
@@ -0,0 +1 @@
+66d7e23ec93e42784e7f3baf20b298d2
\ No newline at end of file
diff --git a/LayoutTests/fast/text/setData-dirty-lines-expected.png b/LayoutTests/fast/text/setData-dirty-lines-expected.png
new file mode 100644
index 0000000..6308800
Binary files /dev/null and b/LayoutTests/fast/text/setData-dirty-lines-expected.png differ
diff --git a/LayoutTests/fast/text/setData-dirty-lines-expected.txt b/LayoutTests/fast/text/setData-dirty-lines-expected.txt
new file mode 100644
index 0000000..a24e6f9
--- /dev/null
+++ b/LayoutTests/fast/text/setData-dirty-lines-expected.txt
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+layer at (8,8) size 784x584
+ RenderBody {BODY} at (8,8) size 784x584
+layer at (8,8) size 200x120
+ RenderBlock (positioned) {DIV} at (0,0) size 200x120 [color=#FF0000]
+ RenderText {#text} at (0,0) size 200x120
+ text run at (0,0) width 200: ".AAAA"
+ text run at (0,40) width 160: "B CC"
+ text run at (0,80) width 80: "D "
+ RenderText {#text} at (80,80) size 40x40
+ text run at (80,80) width 40: "E"
+layer at (8,8) size 200x120
+ RenderBlock (positioned) {DIV} at (0,0) size 200x120 [color=#008000]
+ RenderText {#text} at (0,0) size 200x120
+ text run at (0,0) width 200: ".AAAA"
+ text run at (0,40) width 160: "B CC"
+ text run at (0,80) width 120: "D E"
diff --git a/LayoutTests/fast/text/setData-dirty-lines.html b/LayoutTests/fast/text/setData-dirty-lines.html
new file mode 100644
index 0000000..dc0cc82
--- /dev/null
+++ b/LayoutTests/fast/text/setData-dirty-lines.html
@@ -0,0 +1,17 @@
+<head>
+ <style>
+ div { width: 200px; font-family: ahem; font-size: 40px; position: absolute; top: 0; left: 0; -webkit-font-smoothing: none; }
+ </style>
+</head>
+<body style="position: relative;">
+ <!-- There should be no red on the page. -->
+ <div style="color: red;">.AAAA B CC D <!-- -->E</div>
+ <div id="target" style="color: green;">AAAA B CC D <!-- -->E</div>
+ <script>
+ var target = document.getElementById("target");
+ target.removeChild(target.childNodes[1]);
+ target.offsetTop;
+ target.normalize();
+ target.firstChild.data = "." + target.firstChild.data;
+ </script>
+</body>
diff --git a/LayoutTests/fast/text/splitText-dirty-lines-expected.checksum b/LayoutTests/fast/text/splitText-dirty-lines-expected.checksum
new file mode 100644
index 0000000..81e5ff8
--- /dev/null
+++ b/LayoutTests/fast/text/splitText-dirty-lines-expected.checksum
@@ -0,0 +1 @@
+f00fcd0b84ffe01c68242462dc1cbd50
\ No newline at end of file
diff --git a/LayoutTests/fast/text/splitText-dirty-lines-expected.png b/LayoutTests/fast/text/splitText-dirty-lines-expected.png
new file mode 100644
index 0000000..2472050
Binary files /dev/null and b/LayoutTests/fast/text/splitText-dirty-lines-expected.png differ
diff --git a/LayoutTests/fast/text/splitText-dirty-lines-expected.txt b/LayoutTests/fast/text/splitText-dirty-lines-expected.txt
new file mode 100644
index 0000000..dff7719
--- /dev/null
+++ b/LayoutTests/fast/text/splitText-dirty-lines-expected.txt
@@ -0,0 +1,23 @@
+layer at (0,0) size 800x600
+ RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+ RenderBlock {HTML} at (0,0) size 800x600
+layer at (8,8) size 784x584
+ RenderBody {BODY} at (8,8) size 784x584
+layer at (8,8) size 200x160
+ RenderBlock (positioned) {DIV} at (0,0) size 200x160 [color=#FF0000]
+ RenderText {#text} at (0,0) size 160x160
+ text run at (0,0) width 160: "AAAA"
+ text run at (0,40) width 40: "B"
+ text run at (0,80) width 160: "CCCC"
+ text run at (0,120) width 80: "D "
+ RenderText {#text} at (80,120) size 40x40
+ text run at (80,120) width 40: "E"
+layer at (8,8) size 200x160
+ RenderBlock (positioned) {DIV} at (0,0) size 200x160 [color=#008000]
+ RenderText {#text} at (0,0) size 0x0
+ RenderText {#text} at (0,0) size 160x160
+ text run at (0,0) width 160: "AAAA"
+ text run at (0,40) width 40: "B"
+ text run at (0,80) width 160: "CCCC"
+ text run at (0,120) width 120: "D E"
diff --git a/LayoutTests/fast/text/splitText-dirty-lines.html b/LayoutTests/fast/text/splitText-dirty-lines.html
new file mode 100644
index 0000000..b121d29
--- /dev/null
+++ b/LayoutTests/fast/text/splitText-dirty-lines.html
@@ -0,0 +1,17 @@
+<head>
+ <style>
+ div { width: 200px; font-family: ahem; font-size: 40px; position: absolute; top: 0; left: 0; -webkit-font-smoothing: none; }
+ </style>
+</head>
+<body style="position: relative;">
+ <!-- There should be no red on the page. -->
+ <div style="color: red;">AAAA B CCCC D <!-- -->E</div>
+ <div id="target" style="color: green;">AAAA B CCCC D <!-- -->E</div>
+ <script>
+ var target = document.getElementById("target");
+ target.removeChild(target.childNodes[1]);
+ target.offsetTop;
+ target.normalize();
+ target.firstChild.splitText(0);
+ </script>
+</body>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e021d13..bd18dc4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-06-29 Dan Bernstein <mitz at apple.com>
+
+ Reviewed by Darin Adler.
+
+ <rdar://problem/7975842> Certain text is repeated after using splitText()
+
+ Tests: fast/text/setData-dirty-lines.html
+ fast/text/splitText-dirty-lines.html
+
+ * dom/CharacterData.cpp:
+ (WebCore::CharacterData::setData): Call RenderText::setTextWithOffset() rather than
+ setText(), because only the former correctly dirties line boxes.
+ * dom/Text.cpp:
+ (WebCore::Text::splitText): Ditto.
+
2010-06-25 Dan Bernstein <mitz at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebCore/dom/CharacterData.cpp b/WebCore/dom/CharacterData.cpp
index 3c3dc37..cb12184 100644
--- a/WebCore/dom/CharacterData.cpp
+++ b/WebCore/dom/CharacterData.cpp
@@ -46,15 +46,15 @@ void CharacterData::setData(const String& data, ExceptionCode&)
int oldLength = length();
RefPtr<StringImpl> oldStr = m_data;
m_data = dataImpl;
-
+
if ((!renderer() || !rendererIsNeeded(renderer()->style())) && attached()) {
detach();
attach();
} else if (renderer())
- toRenderText(renderer())->setText(m_data);
-
+ toRenderText(renderer())->setTextWithOffset(m_data, 0, oldLength);
+
dispatchModifiedEvent(oldStr.get());
-
+
document()->textRemoved(this, 0, oldLength);
}
diff --git a/WebCore/dom/Text.cpp b/WebCore/dom/Text.cpp
index 1ce074a..229fa88 100644
--- a/WebCore/dom/Text.cpp
+++ b/WebCore/dom/Text.cpp
@@ -77,7 +77,7 @@ PassRefPtr<Text> Text::splitText(unsigned offset, ExceptionCode& ec)
document()->textNodeSplit(this);
if (renderer())
- toRenderText(renderer())->setText(dataImpl());
+ toRenderText(renderer())->setTextWithOffset(dataImpl(), 0, oldStr->length());
return newText.release();
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list