Title: [155378] trunk
- Revision
- 155378
- Author
- [email protected]
- Date
- 2013-09-09 13:28:39 -0700 (Mon, 09 Sep 2013)
Log Message
Internals should always cause a layout before calling into TextIterator
https://bugs.webkit.org/show_bug.cgi?id=120891
Reviewed by Antti Koivisto.
Source/WebCore:
Inspired by https://chromium.googlesource.com/chromium/blink/+/5fee5da7b04a710171c79bd6e87eca3533188e45.
Force a layout in the constructors of TextIterator, and SimplifiedBackwardsTextIterator and remove
superfluous calls to updateLayout() in other places.
As much as I hate for a constructor to have a side effect like this, I couldn't think of a better place
to update the layout. Unfortunately, we're slowly moving away from manually createing TextIterator and
wrapping them in a static function.
* editing/TextIterator.cpp:
(WebCore::TextIterator::TextIterator):
(WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
(WebCore::TextIterator::rangeFromLocationAndLength):
(WebCore::findPlainText):
LayoutTests:
Progression.
* platform/mac/editing/input/caret-primary-bidi-expected.txt:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (155377 => 155378)
--- trunk/LayoutTests/ChangeLog 2013-09-09 20:23:21 UTC (rev 155377)
+++ trunk/LayoutTests/ChangeLog 2013-09-09 20:28:39 UTC (rev 155378)
@@ -1,3 +1,14 @@
+2013-09-06 Ryosuke Niwa <[email protected]>
+
+ Internals should always cause a layout before calling into TextIterator
+ https://bugs.webkit.org/show_bug.cgi?id=120891
+
+ Reviewed by Antti Koivisto.
+
+ Progression.
+
+ * platform/mac/editing/input/caret-primary-bidi-expected.txt:
+
2013-09-09 Mark Lam <[email protected]>
Change some remaining fast/* files to use pre and post js files in LayoutTests/resources.
Modified: trunk/LayoutTests/platform/mac/editing/input/caret-primary-bidi-expected.txt (155377 => 155378)
--- trunk/LayoutTests/platform/mac/editing/input/caret-primary-bidi-expected.txt 2013-09-09 20:23:21 UTC (rev 155377)
+++ trunk/LayoutTests/platform/mac/editing/input/caret-primary-bidi-expected.txt 2013-09-09 20:28:39 UTC (rev 155378)
@@ -1,4 +1,4 @@
-0: 124,508,0,28
+0: 8,564,0,28
1: 21,564,0,28
2: 36,564,0,28
3: 48,564,0,28
Modified: trunk/Source/WebCore/ChangeLog (155377 => 155378)
--- trunk/Source/WebCore/ChangeLog 2013-09-09 20:23:21 UTC (rev 155377)
+++ trunk/Source/WebCore/ChangeLog 2013-09-09 20:28:39 UTC (rev 155378)
@@ -1,3 +1,25 @@
+2013-09-06 Ryosuke Niwa <[email protected]>
+
+ Internals should always cause a layout before calling into TextIterator
+ https://bugs.webkit.org/show_bug.cgi?id=120891
+
+ Reviewed by Antti Koivisto.
+
+ Inspired by https://chromium.googlesource.com/chromium/blink/+/5fee5da7b04a710171c79bd6e87eca3533188e45.
+
+ Force a layout in the constructors of TextIterator, and SimplifiedBackwardsTextIterator and remove
+ superfluous calls to updateLayout() in other places.
+
+ As much as I hate for a constructor to have a side effect like this, I couldn't think of a better place
+ to update the layout. Unfortunately, we're slowly moving away from manually createing TextIterator and
+ wrapping them in a static function.
+
+ * editing/TextIterator.cpp:
+ (WebCore::TextIterator::TextIterator):
+ (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
+ (WebCore::TextIterator::rangeFromLocationAndLength):
+ (WebCore::findPlainText):
+
2013-09-09 David Hyatt <[email protected]>
Move layoutBlock and layoutBlockChildren into RenderBlockFlow
Modified: trunk/Source/WebCore/editing/TextIterator.cpp (155377 => 155378)
--- trunk/Source/WebCore/editing/TextIterator.cpp 2013-09-09 20:23:21 UTC (rev 155377)
+++ trunk/Source/WebCore/editing/TextIterator.cpp 2013-09-09 20:28:39 UTC (rev 155378)
@@ -293,6 +293,8 @@
if (!r)
return;
+ r->ownerDocument().updateLayoutIgnorePendingStylesheets();
+
// get and validate the range endpoints
Node* startContainer = r->startContainer();
if (!startContainer)
@@ -1118,6 +1120,8 @@
if (!r)
return;
+ r->ownerDocument().updateLayoutIgnorePendingStylesheets();
+
Node* startNode = r->startContainer();
if (!startNode)
return;
@@ -2427,7 +2431,6 @@
// FIXME: This is a workaround for the fact that the end of a run is often at the wrong
// position for emitted '\n's.
if (len == 1 && it.characterAt(0) == '\n') {
- scope->document().updateLayoutIgnorePendingStylesheets();
it.advance();
if (!it.atEnd()) {
RefPtr<Range> range = it.range();
@@ -2593,9 +2596,6 @@
PassRefPtr<Range> findPlainText(const Range* range, const String& target, FindOptions options)
{
- // CharacterIterator requires renderers to be up-to-date
- range->ownerDocument().updateLayout();
-
// First, find the text.
size_t matchStart;
size_t matchLength;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes