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

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

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rename functions, update comment Created 4 years, 6 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 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 3261 matching lines...) Expand 10 before | Expand all | Expand 10 after
3272 break; 3272 break;
3273 3273
3274 // Webkit specific extension where offsetParent stops at zoom level chan ges. 3274 // Webkit specific extension where offsetParent stops at zoom level chan ges.
3275 if (effectiveZoom != ancestor->style()->effectiveZoom()) 3275 if (effectiveZoom != ancestor->style()->effectiveZoom())
3276 break; 3276 break;
3277 } 3277 }
3278 3278
3279 return node && node->isElementNode() ? toElement(node) : nullptr; 3279 return node && node->isElementNode() ? toElement(node) : nullptr;
3280 } 3280 }
3281 3281
3282 Element* LayoutObject::unclosedOffsetParent() const
3283 {
3284 Element* element = offsetParent();
3285
3286 while (element && (!element->isUnclosedNodeOf(*node()) || (element->isInShad owTree() && element->containingShadowRoot()->type() == ShadowRootType::UserAgent )))
3287 element = element->layoutObject()->offsetParent();
3288
3289 return element;
3290 }
3291
3282 PositionWithAffinity LayoutObject::createPositionWithAffinity(int offset, TextAf finity affinity) 3292 PositionWithAffinity LayoutObject::createPositionWithAffinity(int offset, TextAf finity affinity)
3283 { 3293 {
3284 // If this is a non-anonymous layoutObject in an editable area, then it's si mple. 3294 // If this is a non-anonymous layoutObject in an editable area, then it's si mple.
3285 if (Node* node = nonPseudoNode()) { 3295 if (Node* node = nonPseudoNode()) {
3286 if (!node->hasEditableStyle()) { 3296 if (!node->hasEditableStyle()) {
3287 // If it can be found, we prefer a visually equivalent position that is editable. 3297 // If it can be found, we prefer a visually equivalent position that is editable.
3288 const Position position = Position(node, offset); 3298 const Position position = Position(node, offset);
3289 Position candidate = mostForwardCaretPosition(position, CanCrossEdit ingBoundary); 3299 Position candidate = mostForwardCaretPosition(position, CanCrossEdit ingBoundary);
3290 if (candidate.anchorNode()->hasEditableStyle()) 3300 if (candidate.anchorNode()->hasEditableStyle())
3291 return PositionWithAffinity(candidate, affinity); 3301 return PositionWithAffinity(candidate, affinity);
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
3708 const blink::LayoutObject* root = object1; 3718 const blink::LayoutObject* root = object1;
3709 while (root->parent()) 3719 while (root->parent())
3710 root = root->parent(); 3720 root = root->parent();
3711 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3721 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3712 } else { 3722 } else {
3713 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n"); 3723 fprintf(stderr, "Cannot showLayoutTree. Root is (nil)\n");
3714 } 3724 }
3715 } 3725 }
3716 3726
3717 #endif 3727 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698