Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(670)

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2003793002: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in PlainTextRange. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated some comments. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
988 } 988 }
989 989
990 bool WebLocalFrameImpl::firstRectForCharacterRange(unsigned location, unsigned l ength, WebRect& rectInViewport) const 990 bool WebLocalFrameImpl::firstRectForCharacterRange(unsigned location, unsigned l ength, WebRect& rectInViewport) const
991 { 991 {
992 if ((location + length < location) && (location + length)) 992 if ((location + length < location) && (location + length))
993 length = 0; 993 length = 0;
994 994
995 Element* editable = frame()->selection().rootEditableElementOrDocumentElemen t(); 995 Element* editable = frame()->selection().rootEditableElementOrDocumentElemen t();
996 if (!editable) 996 if (!editable)
997 return false; 997 return false;
998
999 // TODO(dglazkov): The use of updateStyleAndLayoutIgnorePendingStylesheets n eeds to be audited.
1000 // see http://crbug.com/590369 for more details.
1001 editable->document().updateStyleAndLayoutIgnorePendingStylesheets();
1002
998 const EphemeralRange range = PlainTextRange(location, location + length).cre ateRange(*editable); 1003 const EphemeralRange range = PlainTextRange(location, location + length).cre ateRange(*editable);
999 if (range.isNull()) 1004 if (range.isNull())
1000 return false; 1005 return false;
1001 IntRect intRect = frame()->editor().firstRectForRange(range); 1006 IntRect intRect = frame()->editor().firstRectForRange(range);
1002 rectInViewport = WebRect(intRect); 1007 rectInViewport = WebRect(intRect);
1003 rectInViewport = frame()->view()->contentsToViewport(rectInViewport); 1008 rectInViewport = frame()->view()->contentsToViewport(rectInViewport);
1004 return true; 1009 return true;
1005 } 1010 }
1006 1011
1007 size_t WebLocalFrameImpl::characterIndexForPoint(const WebPoint& pointInViewport ) const 1012 size_t WebLocalFrameImpl::characterIndexForPoint(const WebPoint& pointInViewport ) const
(...skipping 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
2142 { 2147 {
2143 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); 2148 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags));
2144 } 2149 }
2145 2150
2146 void WebLocalFrameImpl::clearActiveFindMatch() 2151 void WebLocalFrameImpl::clearActiveFindMatch()
2147 { 2152 {
2148 ensureTextFinder().clearActiveFindMatch(); 2153 ensureTextFinder().clearActiveFindMatch();
2149 } 2154 }
2150 2155
2151 } // namespace blink 2156 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp ('k') | third_party/WebKit/Source/web/WebRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698