Clean up use of flags in localToContainer-type functions
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Mar 2015 05:32:06 +0000 (05:32 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 15 Mar 2015 05:32:06 +0000 (05:32 +0000)
commit456b8db2b871b13bc081fe13e76474c462192b18
tree0a11f1745ae04672522067fccb114caa12c2ba68
parent8b0e78ccfad041b76be207a3a1a2700294365999
Clean up use of flags in localToContainer-type functions
https://bugs.webkit.org/show_bug.cgi?id=142704

Reviewed by Alexey Proskuryakov.

Source/WebCore:

RenderObject::localToContainerQuad() had the questionable behavior of always
enforcing UseTransforms in the flags. However, a future patch will need to call
localToContainerQuad() without this flag.

Fix by requiring callers of localToAbsoluteQuad(), localToContainerQuad(), localToContainerPoint(),
and absoluteToLocalQuad() to pass the UseTransforms flag in, providing it as a default argument.

The default value of the MapCoordinatesFlags parameter to mapLocalToContainer(),
a lower-level function, is removed.

Sprinkle a few more nullptrs around.

No behavior change.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::selectionGapRectsForRepaint): call the higher-level localToContainerPoint()
instead of mapLocalToContainer().
(WebCore::RenderBlock::absoluteQuads): Pass UseTransforms.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::absoluteQuads): Ditto.
* rendering/RenderBox.h:
* rendering/RenderFlowThread.h:
* rendering/RenderGeometryMap.h:
(WebCore::RenderGeometryMap::absolutePoint):
(WebCore::RenderGeometryMap::absoluteRect):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::collectSelectionRects): This function was erroneously passing
'false' as flags. Pass UseTransforms instead (but no behavior change since
UseTransforms was forced on lower down).
* rendering/RenderInline.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible): UseTransforms is the parameter default, remove it.
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::absoluteQuads):
(WebCore::RenderLineBreak::collectSelectionRects): Another erroneous 'false'.
* rendering/RenderNamedFlowFragment.cpp:
(WebCore::RenderNamedFlowFragment::absoluteQuadsForBoxInRegion):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::localToContainerQuad): Here's where we no longer force
the UseTransforms bit.
(WebCore::RenderObject::localToContainerPoint): Also here.
* rendering/RenderObject.h: I prefer bit flags lined up. Makes it easier to spot errors.
(WebCore::RenderObject::localToAbsoluteQuad):
* rendering/RenderText.cpp:
(WebCore::RenderText::collectSelectionRects): Another bad 'false'.
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::absoluteRectsForRange):
(WebCore::RenderTextLineBoxes::absoluteQuads):
(WebCore::RenderTextLineBoxes::absoluteQuadsForRange):
* rendering/RenderView.h:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::collectAbsoluteQuads):
* rendering/svg/RenderSVGForeignObject.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::absoluteQuads): Another bad 'false'.
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::absoluteQuads):
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::absoluteQuads):
* rendering/svg/RenderSVGText.h:
* rendering/svg/SVGRenderSupport.h:

Source/WebKit2:

Pass UseTransforms explicitly to localToContainerPoint()

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderFlowThread.h
Source/WebCore/rendering/RenderGeometryMap.h
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderInline.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLineBreak.cpp
Source/WebCore/rendering/RenderNamedFlowFragment.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderText.cpp
Source/WebCore/rendering/RenderTextLineBoxes.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp
Source/WebCore/rendering/svg/RenderSVGForeignObject.h
Source/WebCore/rendering/svg/RenderSVGInline.cpp
Source/WebCore/rendering/svg/RenderSVGInline.h
Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
Source/WebCore/rendering/svg/RenderSVGModelObject.h
Source/WebCore/rendering/svg/RenderSVGRoot.h
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/RenderSVGText.h
Source/WebCore/rendering/svg/SVGRenderSupport.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm