RESOLVED FIXED Bug 35225
Remove addScrolledContentOffset/subtractScrolledContentOffset
https://bugs.webkit.org/show_bug.cgi?id=35225
Summary Remove addScrolledContentOffset/subtractScrolledContentOffset
Simon Fraser (smfr)
Reported 2010-02-21 19:41:01 PST
scrolledContentOffset is already available as an IntPoint. We should just use it.
Attachments
Patch (13.06 KB, patch)
2010-02-21 20:43 PST, Simon Fraser (smfr)
mitz: review+
Simon Fraser (smfr)
Comment 1 2010-02-21 20:43:23 PST
Darin Adler
Comment 2 2010-02-21 20:54:29 PST
Comment on attachment 49182 [details] Patch An excellent idea. > + IntRect clipRect(IntPoint() + m_offset + renderer->view()->layoutDelta(), layer->size()); It's annoying that the way to convert an IntSize to an IntPoint is to do "IntPoint() + size". That might end up doing addition to zero instead of just converting the type. I wish there was a clean idiom for doing that without addition. > void RenderBlock::offsetForContents(int& tx, int& ty) const These arguments are just begging to be turned into an IntPoint&. Some day. > FloatPoint offsetFromRepaintContainer = transformState.mappedPoint(); > - int x = offsetFromRepaintContainer.x(); > - int y = offsetFromRepaintContainer.y(); > > if (hasOverflowClip()) > - layer()->subtractScrolledContentOffset(x, y); > + offsetFromRepaintContainer -= layer()->scrolledContentOffset(); > + > + int x = offsetFromRepaintContainer.x(); > + int y = offsetFromRepaintContainer.y(); The old code did integer subtraction. This new code does floating point subtraction. r=me too (I see mitz reviewed)
Simon Fraser (smfr)
Comment 3 2010-02-22 10:48:50 PST
Note You need to log in before you can comment on or make changes to this bug.