diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-17 17:59:23 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-17 17:59:23 +0000 |
commit | 084e1e592da2ef49b5d08201e8eae12703728ba9 (patch) | |
tree | 2e545ca7a38edfca4c6e5fdce2e56c3d1ec72c37 | |
parent | 203ff596f347d9809ab7620c23c53012856b1654 (diff) | |
download | chromium_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.cc | 8 |
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; |