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

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

Issue 2387883002: Use float for scroll offset. (Closed)
Patch Set: Fix README.md 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 3867 matching lines...) Expand 10 before | Expand all | Expand 10 after
3878 } 3878 }
3879 3879
3880 bool LayoutBlockFlow::hitTestFloats(HitTestResult& result, 3880 bool LayoutBlockFlow::hitTestFloats(HitTestResult& result,
3881 const HitTestLocation& locationInContainer, 3881 const HitTestLocation& locationInContainer,
3882 const LayoutPoint& accumulatedOffset) { 3882 const LayoutPoint& accumulatedOffset) {
3883 if (!m_floatingObjects) 3883 if (!m_floatingObjects)
3884 return false; 3884 return false;
3885 3885
3886 LayoutPoint adjustedLocation = accumulatedOffset; 3886 LayoutPoint adjustedLocation = accumulatedOffset;
3887 if (isLayoutView()) { 3887 if (isLayoutView()) {
3888 DoublePoint position = 3888 ScrollOffset offset = toLayoutView(this)->frameView()->scrollOffset();
3889 toLayoutView(this)->frameView()->scrollPositionDouble(); 3889 adjustedLocation.move(LayoutSize(offset));
3890 adjustedLocation.move(position.x(), position.y());
3891 } 3890 }
3892 3891
3893 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3892 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
3894 FloatingObjectSetIterator begin = floatingObjectSet.begin(); 3893 FloatingObjectSetIterator begin = floatingObjectSet.begin();
3895 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) { 3894 for (FloatingObjectSetIterator it = floatingObjectSet.end(); it != begin;) {
3896 --it; 3895 --it;
3897 const FloatingObject& floatingObject = *it->get(); 3896 const FloatingObject& floatingObject = *it->get();
3898 if (floatingObject.shouldPaint()) { 3897 if (floatingObject.shouldPaint()) {
3899 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) - 3898 LayoutUnit xOffset = xPositionForFloatIncludingMargin(floatingObject) -
3900 floatingObject.layoutObject()->location().x(); 3899 floatingObject.layoutObject()->location().x();
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
4186 4185
4187 ASSERT(dialog->getCenteringMode() == HTMLDialogElement::NeedsCentering); 4186 ASSERT(dialog->getCenteringMode() == HTMLDialogElement::NeedsCentering);
4188 if (!canCenterDialog) { 4187 if (!canCenterDialog) {
4189 dialog->setNotCentered(); 4188 dialog->setNotCentered();
4190 return; 4189 return;
4191 } 4190 }
4192 4191
4193 FrameView* frameView = document().view(); 4192 FrameView* frameView = document().view();
4194 LayoutUnit top = LayoutUnit((style()->position() == FixedPosition) 4193 LayoutUnit top = LayoutUnit((style()->position() == FixedPosition)
4195 ? 0 4194 ? 0
4196 : frameView->scrollOffset().height()); 4195 : frameView->scrollOffsetInt().height());
4197 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height(); 4196 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height();
4198 if (size().height() < visibleHeight) 4197 if (size().height() < visibleHeight)
4199 top += (visibleHeight - size().height()) / 2; 4198 top += (visibleHeight - size().height()) / 2;
4200 setY(top); 4199 setY(top);
4201 dialog->setCentered(top); 4200 dialog->setCentered(top);
4202 } 4201 }
4203 4202
4204 void LayoutBlockFlow::simplifiedNormalFlowInlineLayout() { 4203 void LayoutBlockFlow::simplifiedNormalFlowInlineLayout() {
4205 ASSERT(childrenInline()); 4204 ASSERT(childrenInline());
4206 ListHashSet<RootInlineBox*> lineBoxes; 4205 ListHashSet<RootInlineBox*> lineBoxes;
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
4462 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState); 4461 return LayoutBlock::invalidatePaintIfNeeded(paintInvalidationState);
4463 } 4462 }
4464 4463
4465 void LayoutBlockFlow::invalidateDisplayItemClients( 4464 void LayoutBlockFlow::invalidateDisplayItemClients(
4466 PaintInvalidationReason invalidationReason) const { 4465 PaintInvalidationReason invalidationReason) const {
4467 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients( 4466 BlockFlowPaintInvalidator(*this).invalidateDisplayItemClients(
4468 invalidationReason); 4467 invalidationReason);
4469 } 4468 }
4470 4469
4471 } // namespace blink 4470 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlock.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698