summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-17 17:59:23 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-17 17:59:23 +0000
commit084e1e592da2ef49b5d08201e8eae12703728ba9 (patch)
tree2e545ca7a38edfca4c6e5fdce2e56c3d1ec72c37
parent203ff596f347d9809ab7620c23c53012856b1654 (diff)
downloadchromium_src-084e1e592da2ef49b5d08201e8eae12703728ba9.zip
chromium_src-084e1e592da2ef49b5d08201e8eae12703728ba9.tar.gz
chromium_src-084e1e592da2ef49b5d08201e8eae12703728ba9.tar.bz2
Fixes crasher in FrameContentAsPlainText. TextIterator iterates over
the visual representation. As such, we need to make sure the frame is layed out, otherwise things are in a weird state and we get a crasher. BUG=4123 TEST=Go to http://www.orkutplus.net/category/orkut-themes and make sure we don't crash Review URL: http://codereview.chromium.org/21364 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9886 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/webframe_impl.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index b8b70db..a6d3c96 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -205,6 +205,14 @@ static void FrameContentAsPlainText(int max_chars, Frame* frame,
if (!doc)
return;
+ if (!frame->view())
+ return;
+
+ // TextIterator iterates over the visual representation of the DOM. As such,
+ // it requires you to do a layout before using it (otherwise it'll crash).
+ if (frame->view()->needsLayout())
+ frame->view()->layout();
+
// Select the document body.
RefPtr<Range> range(doc->createRange());
ExceptionCode exception = 0;