WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch for landing
bug-128481-20140208194008.patch (text/plain), 19.28 KB, created by
Ryosuke Niwa
on 2014-02-08 19:40:08 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2014-02-08 19:40:08 PST
Size:
19.28 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 163735) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,37 @@ >+2014-02-08 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Cleanup the interface of FrameSelection >+ https://bugs.webkit.org/show_bug.cgi?id=128481 >+ >+ Reviewed by Andreas Kling. >+ >+ Removed FrameSelection::end() as intended in r163232, and the stale declaration of >+ paintDragCaret() which was supposed to be removed when we extracted DragCaretController. >+ >+ Renamed caretRenderer() to caretRendererWithoutUpdatingLayout() to clarify the contract >+ as the only caller of this function is RenderBlock::paintCaret. Also renamed bounds() >+ to selectionBounds() to make it more easily identifiable / grep'able. >+ >+ In addition, made recomputeCaretRect() and invalidateCaretRect() private. >+ >+ * WebCore.exp.in: >+ * editing/FrameSelection.cpp: >+ (WebCore::FrameSelection::caretRendererWithoutUpdatingLayout): >+ (WebCore::FrameSelection::selectionBounds): >+ (WebCore::FrameSelection::revealSelection): >+ * editing/FrameSelection.h: >+ (WebCore::FrameSelection::setCaretVisible): >+ * page/DragController.cpp: >+ (WebCore::dragLocForSelectionDrag): >+ * page/FrameSnapshotting.cpp: >+ (WebCore::snapshotSelection): >+ * page/win/FrameWin.cpp: >+ (WebCore::imageFromSelection): >+ * rendering/RenderBlock.cpp: >+ (WebCore::RenderBlock::paintCaret): >+ * testing/Internals.cpp: >+ (WebCore::Internals::selectionBounds): >+ > 2014-02-08 Dan Bernstein <mitz@apple.com> > > Remove outdated workarounds in DocumentLoader::dataReceived >Index: Source/WebCore/WebCore.exp.in >=================================================================== >--- Source/WebCore/WebCore.exp.in (revision 163726) >+++ Source/WebCore/WebCore.exp.in (working copy) >@@ -1555,10 +1555,10 @@ __ZNK7WebCore14DocumentLoader9isLoadingE > __ZNK7WebCore14DocumentMarker11descriptionEv > __ZNK7WebCore14FrameSelection11currentFormEv > __ZNK7WebCore14FrameSelection15copyTypingStyleEv >+__ZNK7WebCore14FrameSelection15selectionBoundsEb > __ZNK7WebCore14FrameSelection18isFocusedAndActiveEv > __ZNK7WebCore14FrameSelection31getClippedVisibleTextRectanglesERN3WTF6VectorINS_9FloatRectELm0ENS1_15CrashOnOverflowEEE > __ZNK7WebCore14FrameSelection36rootEditableElementOrDocumentElementEv >-__ZNK7WebCore14FrameSelection6boundsEb > __ZNK7WebCore14InsertionPoint8isActiveEv > __ZNK7WebCore14RenderListItem10markerTextEv > __ZNK7WebCore14ResourceBuffer4dataEv >Index: Source/WebCore/editing/FrameSelection.cpp >=================================================================== >--- Source/WebCore/editing/FrameSelection.cpp (revision 163726) >+++ Source/WebCore/editing/FrameSelection.cpp (working copy) >@@ -1344,7 +1344,7 @@ bool CaretBase::updateCaretRect(Document > return true; > } > >-RenderObject* FrameSelection::caretRenderer() const >+RenderObject* FrameSelection::caretRendererWithoutUpdatingLayout() const > { > return WebCore::caretRenderer(m_selection.start().deprecatedNode()); > } >@@ -1977,7 +1977,7 @@ bool FrameSelection::shouldDeleteSelecti > return m_frame->editor().client()->shouldDeleteRange(selection.toNormalizedRange().get()); > } > >-FloatRect FrameSelection::bounds(bool clipToVisibleContent) const >+FloatRect FrameSelection::selectionBounds(bool clipToVisibleContent) const > { > if (!m_frame->document()) > return LayoutRect(); >@@ -2065,7 +2065,7 @@ void FrameSelection::revealSelection(con > rect = absoluteCaretBounds(); > break; > case VisibleSelection::RangeSelection: >- rect = revealExtentOption == RevealExtent ? VisiblePosition(m_selection.extent()).absoluteCaretBounds() : enclosingIntRect(bounds(false)); >+ rect = revealExtentOption == RevealExtent ? VisiblePosition(m_selection.extent()).absoluteCaretBounds() : enclosingIntRect(selectionBounds(false)); > break; > } > >Index: Source/WebCore/editing/FrameSelection.h >=================================================================== >--- Source/WebCore/editing/FrameSelection.h (revision 163726) >+++ Source/WebCore/editing/FrameSelection.h (working copy) >@@ -165,10 +165,8 @@ public: > void setExtent(const VisiblePosition&, EUserTriggered = NotUserTriggered); > void setExtent(const Position&, EAffinity, EUserTriggered = NotUserTriggered); > >- Position end() const { return m_selection.end(); } >- > // Return the renderer that is responsible for painting the caret (in the selection start node) >- RenderObject* caretRenderer() const; >+ RenderObject* caretRendererWithoutUpdatingLayout() const; > > // Caret rect local to the caret's renderer > LayoutRect localCaretRect(); >@@ -193,8 +191,6 @@ public: > void textWasReplaced(CharacterData*, unsigned offset, unsigned oldLength, unsigned newLength); > > void setCaretVisible(bool caretIsVisible) { setCaretVisibility(caretIsVisible ? Visible : Hidden); } >- bool recomputeCaretRect(); >- void invalidateCaretRect(); > void paintCaret(GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect); > > // Used to suspend caret blinking while the mouse is down. >@@ -257,14 +253,12 @@ public: > enum EndPointsAdjustmentMode { AdjustEndpointsAtBidiBoundary, DoNotAdjsutEndpoints }; > void setSelectionByMouseIfDifferent(const VisibleSelection&, TextGranularity, EndPointsAdjustmentMode = DoNotAdjsutEndpoints); > >- void paintDragCaret(GraphicsContext*, const LayoutPoint&, const LayoutRect& clipRect) const; >- > EditingStyle* typingStyle() const; > PassRefPtr<MutableStyleProperties> copyTypingStyle() const; > void setTypingStyle(PassRefPtr<EditingStyle>); > void clearTypingStyle(); > >- FloatRect bounds(bool clipToVisibleContent = true) const; >+ FloatRect selectionBounds(bool clipToVisibleContent = true) const; > > void getClippedVisibleTextRectangles(Vector<FloatRect>&) const; > >@@ -317,6 +311,8 @@ private: > void caretBlinkTimerFired(Timer<FrameSelection>&); > > void setCaretVisibility(CaretVisibility); >+ bool recomputeCaretRect(); >+ void invalidateCaretRect(); > > bool dispatchSelectStart(); > >Index: Source/WebCore/page/DragController.cpp >=================================================================== >--- Source/WebCore/page/DragController.cpp (revision 163726) >+++ Source/WebCore/page/DragController.cpp (working copy) >@@ -697,7 +697,7 @@ static IntPoint dragLocForDHTMLDrag(cons > > static IntPoint dragLocForSelectionDrag(Frame& src) > { >- IntRect draggingRect = enclosingIntRect(src.selection().bounds()); >+ IntRect draggingRect = enclosingIntRect(src.selection().selectionBounds()); > int xpos = draggingRect.maxX(); > xpos = draggingRect.x() < xpos ? draggingRect.x() : xpos; > int ypos = draggingRect.maxY(); >Index: Source/WebCore/page/FrameSnapshotting.cpp >=================================================================== >--- Source/WebCore/page/FrameSnapshotting.cpp (revision 163726) >+++ Source/WebCore/page/FrameSnapshotting.cpp (working copy) >@@ -105,7 +105,7 @@ std::unique_ptr<ImageBuffer> snapshotSel > return nullptr; > > options |= SnapshotOptionsPaintSelectionOnly; >- return snapshotFrameRect(frame, enclosingIntRect(frame.selection().bounds()), options); >+ return snapshotFrameRect(frame, enclosingIntRect(frame.selection().selectionBounds()), options); > } > > std::unique_ptr<ImageBuffer> snapshotNode(Frame& frame, Node& node) >Index: Source/WebCore/page/win/FrameWin.cpp >=================================================================== >--- Source/WebCore/page/win/FrameWin.cpp (revision 163726) >+++ Source/WebCore/page/win/FrameWin.cpp (working copy) >@@ -50,7 +50,7 @@ GDIObject<HBITMAP> imageFromSelection(Fr > frame->document()->updateLayout(); > > frame->view()->setPaintBehavior(PaintBehaviorSelectionOnly | (forceBlackText ? PaintBehaviorForceBlackText : 0)); >- FloatRect fr = frame->selection().bounds(); >+ FloatRect fr = frame->selection().selectionBounds(); > IntRect ir(static_cast<int>(fr.x()), static_cast<int>(fr.y()), static_cast<int>(fr.width()), static_cast<int>(fr.height())); > GDIObject<HBITMAP> image = imageFromRect(frame, ir); > frame->view()->setPaintBehavior(PaintBehaviorNormal); >Index: Source/WebCore/rendering/RenderBlock.cpp >=================================================================== >--- Source/WebCore/rendering/RenderBlock.cpp (revision 163726) >+++ Source/WebCore/rendering/RenderBlock.cpp (working copy) >@@ -2277,7 +2277,7 @@ void RenderBlock::paintCaret(PaintInfo& > RenderObject* caretPainter; > bool isContentEditable; > if (type == CursorCaret) { >- caretPainter = frame().selection().caretRenderer(); >+ caretPainter = frame().selection().caretRendererWithoutUpdatingLayout(); > isContentEditable = frame().selection().selection().hasEditableStyle(); > } else { > caretPainter = frame().page()->dragCaretController().caretRenderer(); >Index: Source/WebCore/testing/Internals.cpp >=================================================================== >--- Source/WebCore/testing/Internals.cpp (revision 163726) >+++ Source/WebCore/testing/Internals.cpp (working copy) >@@ -2135,7 +2135,7 @@ PassRefPtr<ClientRect> Internals::select > return ClientRect::create(); > } > >- return ClientRect::create(document->frame()->selection().bounds()); >+ return ClientRect::create(document->frame()->selection().selectionBounds()); > } > > #if ENABLE(VIBRATION) >Index: Source/WebKit2/ChangeLog >=================================================================== >--- Source/WebKit2/ChangeLog (revision 163735) >+++ Source/WebKit2/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2014-02-08 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Cleanup the interface of FrameSelection >+ https://bugs.webkit.org/show_bug.cgi?id=128481 >+ >+ Reviewed by Andreas Kling. >+ >+ * WebProcess/WebPage/FindController.cpp: >+ (WebKit::FindController::getFindIndicatorBitmapAndRect): >+ (WebKit::FindController::drawRect): >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::scaledSnapshotWithOptions): >+ > 2014-02-08 Brady Eidson <beidson@apple.com> > > IDB: storage/indexeddb/mozilla/cursors.html fails >Index: Source/WebKit2/WebProcess/WebPage/FindController.cpp >=================================================================== >--- Source/WebKit2/WebProcess/WebPage/FindController.cpp (revision 163726) >+++ Source/WebKit2/WebProcess/WebPage/FindController.cpp (working copy) >@@ -201,7 +201,7 @@ void FindController::findStringMatches(c > > bool FindController::getFindIndicatorBitmapAndRect(Frame* frame, ShareableBitmap::Handle& handle, IntRect& selectionRect) > { >- selectionRect = enclosingIntRect(frame->selection().bounds()); >+ selectionRect = enclosingIntRect(frame->selection().selectionBounds()); > > // Selection rect can be empty for matches that are currently obscured from view. > if (selectionRect.isEmpty()) >@@ -427,7 +427,7 @@ void FindController::drawRect(PageOverla > return; > > if (Frame* selectedFrame = frameWithSelection(m_webPage->corePage())) { >- IntRect findIndicatorRect = selectedFrame->view()->contentsToWindow(enclosingIntRect(selectedFrame->selection().bounds())); >+ IntRect findIndicatorRect = selectedFrame->view()->contentsToWindow(enclosingIntRect(selectedFrame->selection().selectionBounds())); > > if (findIndicatorRect != m_findIndicatorRect) > hideFindIndicator(); >Index: Source/WebKit2/WebProcess/WebPage/WebPage.cpp >=================================================================== >--- Source/WebKit2/WebProcess/WebPage/WebPage.cpp (revision 163726) >+++ Source/WebKit2/WebProcess/WebPage/WebPage.cpp (working copy) >@@ -1524,7 +1524,7 @@ PassRefPtr<WebImage> WebPage::scaledSnap > frameView->paintContentsForSnapshot(graphicsContext.get(), rect, shouldPaintSelection, coordinateSpace); > > if (options & SnapshotOptionsPaintSelectionRectangle) { >- FloatRect selectionRectangle = m_mainFrame->coreFrame()->selection().bounds(); >+ FloatRect selectionRectangle = m_mainFrame->coreFrame()->selection().selectionBounds(); > graphicsContext->setStrokeColor(Color(0xFF, 0, 0), ColorSpaceDeviceRGB); > graphicsContext->strokeRect(selectionRectangle, 1); > } >Index: Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in >=================================================================== >--- Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (revision 163726) >+++ Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in (working copy) >@@ -198,7 +198,7 @@ EXPORTS > symbolWithPointer(?absoluteCaretBounds@FrameSelection@WebCore@@QAE?AVIntRect@2@XZ, ?absoluteCaretBounds@FrameSelection@WebCore@@QEAA?AVIntRect@2@XZ) > symbolWithPointer(?afterPseudoElement@Element@WebCore@@QBEPAVPseudoElement@2@XZ, ?afterPseudoElement@Element@WebCore@@QEBAPEAVPseudoElement@2@XZ) > symbolWithPointer(?beforePseudoElement@Element@WebCore@@QBEPAVPseudoElement@2@XZ, ?beforePseudoElement@Element@WebCore@@QEBAPEAVPseudoElement@2@XZ) >- symbolWithPointer(?bounds@FrameSelection@WebCore@@QBE?AVFloatRect@2@_N@Z, ?bounds@FrameSelection@WebCore@@QEBA?AVFloatRect@2@_N@Z) >+ symbolWithPointer(?selectionBounds@FrameSelection@WebCore@@QBE?AVFloatRect@2@_N@Z, ?bounds@FrameSelection@WebCore@@QEBA?AVFloatRect@2@_N@Z) > symbolWithPointer(?fromUTF8@String@WTF@@SA?AV12@PBE@Z, ?fromUTF8@String@WTF@@SA?AV12@PEBE_K@Z) > symbolWithPointer(?fromUTF8WithLatin1Fallback@String@WTF@@SA?AV12@PBEI@Z, ?fromUTF8WithLatin1Fallback@String@WTF@@SA?AV12@PEBE_K@Z) > symbolWithPointer(?garbageCollectDocumentResources@CachedResourceLoader@WebCore@@QAEXXZ, ?garbageCollectDocumentResources@CachedResourceLoader@WebCore@@QEAAXXZ) >Index: Source/WebKit/efl/ChangeLog >=================================================================== >--- Source/WebKit/efl/ChangeLog (revision 163735) >+++ Source/WebKit/efl/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2014-02-08 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Cleanup the interface of FrameSelection >+ https://bugs.webkit.org/show_bug.cgi?id=128481 >+ >+ Reviewed by Andreas Kling. >+ >+ * WebCoreSupport/DumpRenderTreeSupportEfl.cpp: >+ (DumpRenderTreeSupportEfl::selectionRectangle): >+ > 2014-02-08 Darin Adler <darin@apple.com> > > Change TextIterator to use StringView, preparing to wean it from deprecatedCharacters >Index: Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp >=================================================================== >--- Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp (revision 163726) >+++ Source/WebKit/efl/WebCoreSupport/DumpRenderTreeSupportEfl.cpp (working copy) >@@ -199,7 +199,7 @@ WebCore::IntRect DumpRenderTreeSupportEf > { > DRT_SUPPORT_FRAME_GET_OR_RETURN(ewkFrame, frame, WebCore::IntRect()); > >- return enclosingIntRect(frame->selection().bounds()); >+ return enclosingIntRect(frame->selection().selectionBounds()); > } > > // Compare with "WebKit/Tools/DumpRenderTree/mac/FrameLoadDelegate.mm >Index: Source/WebKit/gtk/ChangeLog >=================================================================== >--- Source/WebKit/gtk/ChangeLog (revision 163735) >+++ Source/WebKit/gtk/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2014-02-08 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Cleanup the interface of FrameSelection >+ https://bugs.webkit.org/show_bug.cgi?id=128481 >+ >+ Reviewed by Andreas Kling. >+ >+ * WebCoreSupport/DumpRenderTreeSupportGtk.cpp: >+ (DumpRenderTreeSupportGtk::rectangleForSelection): >+ > 2014-02-08 Darin Adler <darin@apple.com> > > Change TextIterator to use StringView, preparing to wean it from deprecatedCharacters >Index: Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp >=================================================================== >--- Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp (revision 163726) >+++ Source/WebKit/gtk/WebCoreSupport/DumpRenderTreeSupportGtk.cpp (working copy) >@@ -500,7 +500,7 @@ void DumpRenderTreeSupportGtk::rectangle > if (!coreFrame) > return; > >- IntRect bounds = enclosingIntRect(coreFrame->selection().bounds()); >+ IntRect bounds = enclosingIntRect(coreFrame->selection().selectionBounds()); > rectangle->x = bounds.x(); > rectangle->y = bounds.y(); > rectangle->width = bounds.width(); >Index: Source/WebKit/mac/ChangeLog >=================================================================== >--- Source/WebKit/mac/ChangeLog (revision 163735) >+++ Source/WebKit/mac/ChangeLog (working copy) >@@ -1,3 +1,15 @@ >+2014-02-08 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Cleanup the interface of FrameSelection >+ https://bugs.webkit.org/show_bug.cgi?id=128481 >+ >+ Reviewed by Andreas Kling. >+ >+ * WebView/WebHTMLView.mm: >+ (-[WebHTMLView _lookUpInDictionaryFromMenu:]): >+ (-[WebHTMLView selectionRect]): >+ (-[WebHTMLView selectionImageRect]): >+ > 2014-02-08 Dan Bernstein <mitz@apple.com> > > Remove use of PLATFORM(MAC) from WebKit/mac >Index: Source/WebKit/mac/WebView/WebHTMLView.mm >=================================================================== >--- Source/WebKit/mac/WebView/WebHTMLView.mm (revision 163726) >+++ Source/WebKit/mac/WebView/WebHTMLView.mm (working copy) >@@ -5682,7 +5682,7 @@ - (void)_lookUpInDictionaryFromMenu:(id) > if (!coreFrame) > return; > >- NSRect rect = coreFrame->selection().bounds(); >+ NSRect rect = coreFrame->selection().selectionBounds(); > > NSDictionary *attributes = [attrString fontAttributesInRange:NSMakeRange(0,1)]; > NSFont *font = [attributes objectForKey:NSFontAttributeName]; >@@ -6528,7 +6528,7 @@ - (NSRect)selectionRect > { > if (![self _hasSelection]) > return NSZeroRect; >- return core([self _frame])->selection().bounds(); >+ return core([self _frame])->selection().selectionBounds(); > } > > - (NSArray *)selectionTextRects >@@ -6579,7 +6579,7 @@ - (NSRect)selectionImageRect > { > if (![self _hasSelection]) > return NSZeroRect; >- return core([self _frame])->selection().bounds(); >+ return core([self _frame])->selection().selectionBounds(); > } > > #if !PLATFORM(IOS) >Index: Source/WebKit/win/ChangeLog >=================================================================== >--- Source/WebKit/win/ChangeLog (revision 163735) >+++ Source/WebKit/win/ChangeLog (working copy) >@@ -1,3 +1,13 @@ >+2014-02-08 Ryosuke Niwa <rniwa@webkit.org> >+ >+ Cleanup the interface of FrameSelection >+ https://bugs.webkit.org/show_bug.cgi?id=128481 >+ >+ Reviewed by Andreas Kling. >+ >+ * WebView.cpp: >+ (WebView::selectionRect): >+ > 2014-02-08 Darin Adler <darin@apple.com> > > Change TextIterator to use StringView, preparing to wean it from deprecatedCharacters >Index: Source/WebKit/win/WebView.cpp >=================================================================== >--- Source/WebKit/win/WebView.cpp (revision 163726) >+++ Source/WebKit/win/WebView.cpp (working copy) >@@ -3605,7 +3605,7 @@ HRESULT STDMETHODCALLTYPE WebView::selec > { > WebCore::Frame& frame = m_page->focusController().focusedOrMainFrame(); > >- IntRect ir = enclosingIntRect(frame.selection().bounds()); >+ IntRect ir = enclosingIntRect(frame.selection().selectionBounds()); > ir = frame.view()->convertToContainingWindow(ir); > ir.move(-frame.view()->scrollOffset().width(), -frame.view()->scrollOffset().height()); > rc->left = ir.x();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 128481
:
223599
| 223600