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

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

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 int LayoutBox::pixelSnappedClientWidth() const 451 int LayoutBox::pixelSnappedClientWidth() const
452 { 452 {
453 return snapSizeToPixel(clientWidth(), location().x() + clientLeft()); 453 return snapSizeToPixel(clientWidth(), location().x() + clientLeft());
454 } 454 }
455 455
456 int LayoutBox::pixelSnappedClientHeight() const 456 int LayoutBox::pixelSnappedClientHeight() const
457 { 457 {
458 return snapSizeToPixel(clientHeight(), location().y() + clientTop()); 458 return snapSizeToPixel(clientHeight(), location().y() + clientTop());
459 } 459 }
460 460
461 int LayoutBox::pixelSnappedOffsetWidth() const 461 int LayoutBox::pixelSnappedOffsetWidth(const Element*) const
462 { 462 {
463 return snapSizeToPixel(offsetWidth(), location().x() + clientLeft()); 463 return snapSizeToPixel(offsetWidth(), location().x() + clientLeft());
464 } 464 }
465 465
466 int LayoutBox::pixelSnappedOffsetHeight() const 466 int LayoutBox::pixelSnappedOffsetHeight(const Element*) const
467 { 467 {
468 return snapSizeToPixel(offsetHeight(), location().y() + clientTop()); 468 return snapSizeToPixel(offsetHeight(), location().y() + clientTop());
469 } 469 }
470 470
471 LayoutUnit LayoutBox::scrollWidth() const 471 LayoutUnit LayoutBox::scrollWidth() const
472 { 472 {
473 if (hasOverflowClip()) 473 if (hasOverflowClip())
474 return getScrollableArea()->scrollWidth(); 474 return getScrollableArea()->scrollWidth();
475 // For objects with visible overflow, this matches IE. 475 // For objects with visible overflow, this matches IE.
476 // FIXME: Need to work right with writing modes. 476 // FIXME: Need to work right with writing modes.
(...skipping 3961 matching lines...) Expand 10 before | Expand all | Expand 10 after
4438 4438
4439 LayoutRect LayoutBox::visualOverflowRect() const 4439 LayoutRect LayoutBox::visualOverflowRect() const
4440 { 4440 {
4441 if (!m_overflow) 4441 if (!m_overflow)
4442 return borderBoxRect(); 4442 return borderBoxRect();
4443 if (hasOverflowClip()) 4443 if (hasOverflowClip())
4444 return m_overflow->selfVisualOverflowRect(); 4444 return m_overflow->selfVisualOverflowRect();
4445 return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsV isualOverflowRect()); 4445 return unionRect(m_overflow->selfVisualOverflowRect(), m_overflow->contentsV isualOverflowRect());
4446 } 4446 }
4447 4447
4448 LayoutUnit LayoutBox::offsetLeft() const 4448 LayoutUnit LayoutBox::offsetLeft(const Element* parent) const
4449 { 4449 {
4450 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).x(); 4450 return adjustedPositionRelativeTo(topLeftLocation(), parent).x();
4451 } 4451 }
4452 4452
4453 LayoutUnit LayoutBox::offsetTop() const 4453 LayoutUnit LayoutBox::offsetTop(const Element* parent) const
4454 { 4454 {
4455 return adjustedPositionRelativeToOffsetParent(topLeftLocation()).y(); 4455 return adjustedPositionRelativeTo(topLeftLocation(), parent).y();
4456 } 4456 }
4457 4457
4458 LayoutPoint LayoutBox::flipForWritingModeForChild(const LayoutBox* child, const LayoutPoint& point) const 4458 LayoutPoint LayoutBox::flipForWritingModeForChild(const LayoutBox* child, const LayoutPoint& point) const
4459 { 4459 {
4460 if (!style()->isFlippedBlocksWritingMode()) 4460 if (!style()->isFlippedBlocksWritingMode())
4461 return point; 4461 return point;
4462 4462
4463 // The child is going to add in its x(), so we have to make sure it ends up in 4463 // The child is going to add in its x(), so we have to make sure it ends up in
4464 // the right place. 4464 // the right place.
4465 return LayoutPoint(point.x() + size().width() - child->size().width() - (2 * child->location().x()), point.y()); 4465 return LayoutPoint(point.x() + size().width() - child->size().width() - (2 * child->location().x()), point.y());
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
4886 m_rareData->m_snapAreas->remove(&snapArea); 4886 m_rareData->m_snapAreas->remove(&snapArea);
4887 } 4887 }
4888 } 4888 }
4889 4889
4890 SnapAreaSet* LayoutBox::snapAreas() const 4890 SnapAreaSet* LayoutBox::snapAreas() const
4891 { 4891 {
4892 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4892 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4893 } 4893 }
4894 4894
4895 } // namespace blink 4895 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698