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

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

Issue 1574933002: Changed type of border-width longhands from unsigned to float. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added trivial tests safe to rebaseline to TestExpectations Created 4 years, 10 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 return snapSizeToPixel(offsetHeight(), location().y() + clientTop()); 429 return snapSizeToPixel(offsetHeight(), location().y() + clientTop());
430 } 430 }
431 431
432 LayoutUnit LayoutBox::scrollWidth() const 432 LayoutUnit LayoutBox::scrollWidth() const
433 { 433 {
434 if (hasOverflowClip()) 434 if (hasOverflowClip())
435 return layer()->scrollableArea()->scrollWidth(); 435 return layer()->scrollableArea()->scrollWidth();
436 // For objects with visible overflow, this matches IE. 436 // For objects with visible overflow, this matches IE.
437 // FIXME: Need to work right with writing modes. 437 // FIXME: Need to work right with writing modes.
438 if (style()->isLeftToRightDirection()) 438 if (style()->isLeftToRightDirection())
439 return std::max(clientWidth(), layoutOverflowRect().maxX() - borderLeft( )); 439 return std::max(clientWidth(), static_cast<LayoutUnit>((layoutOverflowRe ct().maxX() - borderLeft())));
440 return clientWidth() - std::min(LayoutUnit(), layoutOverflowRect().x() - bor derLeft()); 440 return clientWidth() - std::min(LayoutUnit(), static_cast<LayoutUnit>((layou tOverflowRect().x() - borderLeft())));
441 } 441 }
442 442
443 LayoutUnit LayoutBox::scrollHeight() const 443 LayoutUnit LayoutBox::scrollHeight() const
444 { 444 {
445 if (hasOverflowClip()) 445 if (hasOverflowClip())
446 return layer()->scrollableArea()->scrollHeight(); 446 return layer()->scrollableArea()->scrollHeight();
447 // For objects with visible overflow, this matches IE. 447 // For objects with visible overflow, this matches IE.
448 // FIXME: Need to work right with writing modes. 448 // FIXME: Need to work right with writing modes.
449 return std::max(clientHeight(), layoutOverflowRect().maxY() - borderTop()); 449 return std::max(clientHeight(), LayoutUnit((layoutOverflowRect().maxY() - bo rderTop())));
450 } 450 }
451 451
452 LayoutUnit LayoutBox::scrollLeft() const 452 LayoutUnit LayoutBox::scrollLeft() const
453 { 453 {
454 return hasOverflowClip() ? layer()->scrollableArea()->scrollXOffset() : 0; 454 return hasOverflowClip() ? layer()->scrollableArea()->scrollXOffset() : 0;
455 } 455 }
456 456
457 LayoutUnit LayoutBox::scrollTop() const 457 LayoutUnit LayoutBox::scrollTop() const
458 { 458 {
459 return hasOverflowClip() ? layer()->scrollableArea()->scrollYOffset() : 0; 459 return hasOverflowClip() ? layer()->scrollableArea()->scrollYOffset() : 0;
(...skipping 4191 matching lines...) Expand 10 before | Expand all | Expand 10 after
4651 4651
4652 void LayoutBox::clearPercentHeightDescendants() 4652 void LayoutBox::clearPercentHeightDescendants()
4653 { 4653 {
4654 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { 4654 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) {
4655 if (curr->isBox()) 4655 if (curr->isBox())
4656 toLayoutBox(curr)->removeFromPercentHeightContainer(); 4656 toLayoutBox(curr)->removeFromPercentHeightContainer();
4657 } 4657 }
4658 } 4658 }
4659 4659
4660 } // namespace blink 4660 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698