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

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

Issue 2431473003: Intersection Observer support for OOPIF (Closed)
Patch Set: Addressed dcheng comments Created 3 years, 11 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 if (!(mode & InputIsInFrameCoordinates)) { 336 if (!(mode & InputIsInFrameCoordinates)) {
337 transformState.move(LayoutSize(-frame()->view()->getScrollOffset())); 337 transformState.move(LayoutSize(-frame()->view()->getScrollOffset()));
338 } else { 338 } else {
339 // The flag applies to immediate LayoutView only. 339 // The flag applies to immediate LayoutView only.
340 mode &= ~InputIsInFrameCoordinates; 340 mode &= ~InputIsInFrameCoordinates;
341 } 341 }
342 342
343 transformState.move(parentDocLayoutItem.contentBoxOffset()); 343 transformState.move(parentDocLayoutItem.contentBoxOffset());
344 344
345 parentDocLayoutItem.mapLocalToAncestor(ancestor, transformState, mode); 345 parentDocLayoutItem.mapLocalToAncestor(ancestor, transformState, mode);
346 } else {
347 frameView()->applyTransformForTopFrameSpace(transformState);
346 } 348 }
347 } 349 }
348 } 350 }
349 351
350 const LayoutObject* LayoutView::pushMappingToContainer( 352 const LayoutObject* LayoutView::pushMappingToContainer(
351 const LayoutBoxModelObject* ancestorToStopAt, 353 const LayoutBoxModelObject* ancestorToStopAt,
352 LayoutGeometryMap& geometryMap) const { 354 LayoutGeometryMap& geometryMap) const {
353 LayoutSize offset; 355 LayoutSize offset;
354 LayoutObject* container = nullptr; 356 LayoutObject* container = nullptr;
355 357
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 458
457 bool LayoutView::mapToVisualRectInAncestorSpace( 459 bool LayoutView::mapToVisualRectInAncestorSpace(
458 const LayoutBoxModelObject* ancestor, 460 const LayoutBoxModelObject* ancestor,
459 LayoutRect& rect, 461 LayoutRect& rect,
460 MapCoordinatesFlags mode, 462 MapCoordinatesFlags mode,
461 VisualRectFlags visualRectFlags) const { 463 VisualRectFlags visualRectFlags) const {
462 if (mode & IsFixed) 464 if (mode & IsFixed)
463 rect.move(offsetForFixedPosition(true)); 465 rect.move(offsetForFixedPosition(true));
464 466
465 // Apply our transform if we have one (because of full page zooming). 467 // Apply our transform if we have one (because of full page zooming).
466 if (!ancestor && layer() && layer()->transform()) 468 if (layer() && layer()->transform())
467 rect = layer()->transform()->mapRect(rect); 469 rect = layer()->transform()->mapRect(rect);
468 470
469 ASSERT(ancestor);
470 if (ancestor == this) 471 if (ancestor == this)
471 return true; 472 return true;
472 473
473 Element* owner = document().localOwner(); 474 Element* owner = document().localOwner();
474 if (!owner) 475 if (!owner)
475 return true; 476 return frameView()->mapToVisualRectInTopFrameSpace(rect);
476 477
477 if (LayoutBox* obj = owner->layoutBox()) { 478 if (LayoutBox* obj = owner->layoutBox()) {
478 if (!(mode & InputIsInFrameCoordinates)) { 479 if (!(mode & InputIsInFrameCoordinates)) {
479 // Intersect the viewport with the visual rect. 480 // Intersect the viewport with the visual rect.
480 LayoutRect viewRectangle = viewRect(); 481 LayoutRect viewRectangle = viewRect();
481 if (visualRectFlags & EdgeInclusive) { 482 if (visualRectFlags & EdgeInclusive) {
482 if (!rect.inclusiveIntersect(viewRectangle)) 483 if (!rect.inclusiveIntersect(viewRectangle))
483 return false; 484 return false;
484 } else { 485 } else {
485 rect.intersect(viewRectangle); 486 rect.intersect(viewRectangle);
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { 1036 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const {
1036 // Frame scroll corner is painted using LayoutView as the display item client. 1037 // Frame scroll corner is painted using LayoutView as the display item client.
1037 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && 1038 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() &&
1038 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar())) 1039 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar()))
1039 return false; 1040 return false;
1040 1041
1041 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); 1042 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize();
1042 } 1043 }
1043 1044
1044 } // namespace blink 1045 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698