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

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

Issue 2431473003: Intersection Observer support for OOPIF (Closed)
Patch Set: Applying root scroll offset better Created 4 years 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 if (!document().frame()->isMainFrame()) {
347 // This is the case of a Frame with a remote parent.
348 DCHECK(!ancestor);
349 LayoutRect viewportIntersectionRect(
350 frameView()->remoteViewportIntersection());
351 transformState.move(LayoutSize(-viewportIntersectionRect.x(),
352 -viewportIntersectionRect.y()));
346 } 353 }
347 } 354 }
348 } 355 }
349 356
350 const LayoutObject* LayoutView::pushMappingToContainer( 357 const LayoutObject* LayoutView::pushMappingToContainer(
351 const LayoutBoxModelObject* ancestorToStopAt, 358 const LayoutBoxModelObject* ancestorToStopAt,
352 LayoutGeometryMap& geometryMap) const { 359 LayoutGeometryMap& geometryMap) const {
353 LayoutSize offset; 360 LayoutSize offset;
354 LayoutObject* container = nullptr; 361 LayoutObject* container = nullptr;
355 362
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 460
454 bool LayoutView::mapToVisualRectInAncestorSpace( 461 bool LayoutView::mapToVisualRectInAncestorSpace(
455 const LayoutBoxModelObject* ancestor, 462 const LayoutBoxModelObject* ancestor,
456 LayoutRect& rect, 463 LayoutRect& rect,
457 MapCoordinatesFlags mode, 464 MapCoordinatesFlags mode,
458 VisualRectFlags visualRectFlags) const { 465 VisualRectFlags visualRectFlags) const {
459 if (mode & IsFixed) 466 if (mode & IsFixed)
460 rect.move(offsetForFixedPosition(true)); 467 rect.move(offsetForFixedPosition(true));
461 468
462 // Apply our transform if we have one (because of full page zooming). 469 // Apply our transform if we have one (because of full page zooming).
463 if (!ancestor && layer() && layer()->transform()) 470 if (layer() && layer()->transform())
464 rect = layer()->transform()->mapRect(rect); 471 rect = layer()->transform()->mapRect(rect);
465 472
466 ASSERT(ancestor);
467 if (ancestor == this) 473 if (ancestor == this)
468 return true; 474 return true;
469 475
470 Element* owner = document().localOwner(); 476 Element* owner = document().localOwner();
471 if (!owner) 477 if (!owner) {
478 // This is the case of a Frame with a remote parent.
479 if (!document().frame()->isMainFrame()) {
480 DCHECK(!ancestor);
481 LayoutRect viewportIntersectionRect(
482 frameView()->remoteViewportIntersection());
483 rect.intersect(viewportIntersectionRect);
484 if (rect.isEmpty())
485 return false;
486 }
472 return true; 487 return true;
488 }
473 489
474 if (LayoutBox* obj = owner->layoutBox()) { 490 if (LayoutBox* obj = owner->layoutBox()) {
475 if (!(mode & InputIsInFrameCoordinates)) { 491 if (!(mode & InputIsInFrameCoordinates)) {
476 // Intersect the viewport with the visual rect. 492 // Intersect the viewport with the visual rect.
477 LayoutRect viewRectangle = viewRect(); 493 LayoutRect viewRectangle = viewRect();
478 if (visualRectFlags & EdgeInclusive) { 494 if (visualRectFlags & EdgeInclusive) {
479 if (!rect.inclusiveIntersect(viewRectangle)) 495 if (!rect.inclusiveIntersect(viewRectangle))
480 return false; 496 return false;
481 } else { 497 } else {
482 rect.intersect(viewRectangle); 498 rect.intersect(viewRectangle);
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { 1046 bool LayoutView::paintedOutputOfObjectHasNoEffectRegardlessOfSize() const {
1031 // Frame scroll corner is painted using LayoutView as the display item client. 1047 // Frame scroll corner is painted using LayoutView as the display item client.
1032 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() && 1048 if (!RuntimeEnabledFeatures::rootLayerScrollingEnabled() &&
1033 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar())) 1049 (frameView()->horizontalScrollbar() || frameView()->verticalScrollbar()))
1034 return false; 1050 return false;
1035 1051
1036 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize(); 1052 return LayoutBlockFlow::paintedOutputOfObjectHasNoEffectRegardlessOfSize();
1037 } 1053 }
1038 1054
1039 } // namespace blink 1055 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698