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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: tweaks and docs Created 4 years, 2 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 3704 matching lines...) Expand 10 before | Expand all | Expand 10 after
3715 } 3715 }
3716 3716
3717 bool LayoutBlockFlow::hitTestFloats(HitTestResult& result, 3717 bool LayoutBlockFlow::hitTestFloats(HitTestResult& result,
3718 const HitTestLocation& locationInContainer, 3718 const HitTestLocation& locationInContainer,
3719 const LayoutPoint& accumulatedOffset) { 3719 const LayoutPoint& accumulatedOffset) {
3720 if (!m_floatingObjects) 3720 if (!m_floatingObjects)
3721 return false; 3721 return false;
3722 3722
3723 LayoutPoint adjustedLocation = accumulatedOffset; 3723 LayoutPoint adjustedLocation = accumulatedOffset;
3724 if (isLayoutView()) { 3724 if (isLayoutView()) {
3725 DoublePoint position = 3725 ScrollOffset offset = toLayoutView(this)->frameView()->scrollOffset();
3726 toLayoutView(this)->frameView()->scrollPositionDouble(); 3726 adjustedLocation.move(LayoutSize(offset));
3727 adjustedLocation.move(position.x(), position.y());
3728 } 3727 }
3729 3728
3730 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3729 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
3731 FloatingObjectSetIterator begin = floatingObjectSet.begin(); 3730 FloatingObjectSetIterator begin = floatingObjectSet.begin();
3732 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) { 3731 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) {
3733 --it; 3732 --it;
3734 const FloatingObject& floatingObject = *it->get(); 3733 const FloatingObject& floatingObject = *it->get();
3735 if (floatingObject.shouldPaint()) { 3734 if (floatingObject.shouldPaint()) {
3736 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) - 3735 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) -
3737 floatingObject.layoutObject()->location().x(); 3736 floatingObject.layoutObject()->location().x();
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
4012 4011
4013 ASSERT(dialog->getCenteringMode() == HTMLDialogElement::NeedsCentering); 4012 ASSERT(dialog->getCenteringMode() == HTMLDialogElement::NeedsCentering);
4014 if (!canCenterDialog) { 4013 if (!canCenterDialog) {
4015 dialog->setNotCentered(); 4014 dialog->setNotCentered();
4016 return; 4015 return;
4017 } 4016 }
4018 4017
4019 FrameView* frameView = document().view(); 4018 FrameView* frameView = document().view();
4020 LayoutUnit top = LayoutUnit((style()->position() == FixedPosition) 4019 LayoutUnit top = LayoutUnit((style()->position() == FixedPosition)
4021 ? 0 4020 ? 0
4022 : frameView->scrollOffset().height()); 4021 : frameView->scrollOffsetInt().height());
4023 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(); 4022 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height();
4024 if (size().height() < visibleHeight) 4023 if (size().height() < visibleHeight)
4025 top += (visibleHeight - size().height()) / 2; 4024 top += (visibleHeight - size().height()) / 2;
4026 setY(top); 4025 setY(top);
4027 dialog->setCentered(top); 4026 dialog->setCentered(top);
4028 } 4027 }
4029 4028
4030 void LayoutBlockFlow::simplifiedNormalFlowInlineLayout() { 4029 void LayoutBlockFlow::simplifiedNormalFlowInlineLayout() {
4031 ASSERT(childrenInline()); 4030 ASSERT(childrenInline());
4032 ListHashSet<RootInlineBox*> lineBoxes; 4031 ListHashSet<RootInlineBox*> lineBoxes;
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
4282 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); 4281 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState);
4283 } 4282 }
4284 4283
4285 void LayoutBlockFlow::invalidateDisplayItemClients( 4284 void LayoutBlockFlow::invalidateDisplayItemClients(
4286 PaintInvalidationReason invalidationReason) const { 4285 PaintInvalidationReason invalidationReason) const {
4287 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( 4286 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(
4288 invalidationReason); 4287 invalidationReason);
4289 } 4288 }
4290 4289
4291 } // namespace blink 4290 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698