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

Side by Side Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-revert the previous and check position:fixed in layout code. Created 4 years, 5 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1296 // For hit-test rect visualization to work, the hit-test rect should 1296 // For hit-test rect visualization to work, the hit-test rect should
1297 // be relative to the scrolling layer and in this case the hit-test 1297 // be relative to the scrolling layer and in this case the hit-test
1298 // rect is relative to the element's own GraphicsLayer. So we will h ave 1298 // rect is relative to the element's own GraphicsLayer. So we will h ave
1299 // to adjust the rect to be relative to the scrolling layer here. 1299 // to adjust the rect to be relative to the scrolling layer here.
1300 // Only when the element's offsetParent == scroller's offsetParent w e 1300 // Only when the element's offsetParent == scroller's offsetParent w e
1301 // can compute the element's relative position to the scrolling cont ent 1301 // can compute the element's relative position to the scrolling cont ent
1302 // in this way. 1302 // in this way.
1303 if (searchRoot->layoutObject()->offsetParent() == searchRoot->parent ()->layoutObject()->offsetParent()) { 1303 if (searchRoot->layoutObject()->offsetParent() == searchRoot->parent ()->layoutObject()->offsetParent()) {
1304 LayoutBoxModelObject* current = searchRoot->layoutObject(); 1304 LayoutBoxModelObject* current = searchRoot->layoutObject();
1305 LayoutBoxModelObject* parent = searchRoot->parent()->layoutObjec t(); 1305 LayoutBoxModelObject* parent = searchRoot->parent()->layoutObjec t();
1306 layerOffset->setWidth((parent->offsetLeft() - current->offsetLef t()).toInt()); 1306 layerOffset->setWidth((parent->offsetLeft(parent->offsetParent() ) - current->offsetLeft(parent->offsetParent())).toInt());
1307 layerOffset->setHeight((parent->offsetTop() - current->offsetTop ()).toInt()); 1307 layerOffset->setHeight((parent->offsetTop(parent->offsetParent() ) - current->offsetTop(parent->offsetParent())).toInt());
1308 return searchRoot->parent(); 1308 return searchRoot->parent();
1309 } 1309 }
1310 } 1310 }
1311 1311
1312 LayoutRect rect; 1312 LayoutRect rect;
1313 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*searchRoot->la youtObject(), rect); 1313 PaintLayer::mapRectInPaintInvalidationContainerToBacking(*searchRoot->la youtObject(), rect);
1314 *layerOffset = IntSize(rect.x(), rect.y()); 1314 *layerOffset = IntSize(rect.x(), rect.y());
1315 return searchRoot; 1315 return searchRoot;
1316 } 1316 }
1317 1317
(...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after
2565 } 2565 }
2566 2566
2567 String Internals::getProgrammaticScrollAnimationState(Node* node) const 2567 String Internals::getProgrammaticScrollAnimationState(Node* node) const
2568 { 2568 {
2569 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node)) 2569 if (ScrollableArea* scrollableArea = scrollableAreaForNode(node))
2570 return scrollableArea->programmaticScrollAnimator().runStateAsText(); 2570 return scrollableArea->programmaticScrollAnimator().runStateAsText();
2571 return String(); 2571 return String();
2572 } 2572 }
2573 2573
2574 } // namespace blink 2574 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698