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

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

Issue 2286543002: Add Length::isPercent and use it in tables. (Closed)
Patch Set: rebase Created 4 years, 3 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. 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 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 if (InlineBox* firstBox = firstLineBoxIncludingCulling()) { 711 if (InlineBox* firstBox = firstLineBoxIncludingCulling()) {
712 topLeft = firstBox->topLeft(); 712 topLeft = firstBox->topLeft();
713 } 713 }
714 return adjustedPositionRelativeTo(topLeft, parent).y(); 714 return adjustedPositionRelativeTo(topLeft, parent).y();
715 } 715 }
716 716
717 static LayoutUnit computeMargin(const LayoutInline* layoutObject, const Length& margin) 717 static LayoutUnit computeMargin(const LayoutInline* layoutObject, const Length& margin)
718 { 718 {
719 if (margin.isFixed()) 719 if (margin.isFixed())
720 return LayoutUnit(margin.value()); 720 return LayoutUnit(margin.value());
721 if (margin.hasPercent()) 721 if (margin.isPercentOrCalc())
722 return minimumValueForLength(margin, std::max(LayoutUnit(), layoutObject ->containingBlock()->availableLogicalWidth())); 722 return minimumValueForLength(margin, std::max(LayoutUnit(), layoutObject ->containingBlock()->availableLogicalWidth()));
723 return LayoutUnit(); 723 return LayoutUnit();
724 } 724 }
725 725
726 LayoutRectOutsets LayoutInline::marginBoxOutsets() const 726 LayoutRectOutsets LayoutInline::marginBoxOutsets() const
727 { 727 {
728 return LayoutRectOutsets(marginTop(), marginRight(), marginBottom(), marginL eft()); 728 return LayoutRectOutsets(marginTop(), marginRight(), marginBottom(), marginL eft());
729 } 729 }
730 730
731 LayoutUnit LayoutInline::marginLeft() const 731 LayoutUnit LayoutInline::marginLeft() const
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1363 void LayoutInline::invalidateDisplayItemClients(PaintInvalidationReason invalida tionReason) const 1363 void LayoutInline::invalidateDisplayItemClients(PaintInvalidationReason invalida tionReason) const
1364 { 1364 {
1365 ObjectPaintInvalidator paintInvalidator(*this); 1365 ObjectPaintInvalidator paintInvalidator(*this);
1366 paintInvalidator.invalidateDisplayItemClient(*this, invalidationReason); 1366 paintInvalidator.invalidateDisplayItemClient(*this, invalidationReason);
1367 1367
1368 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1368 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1369 paintInvalidator.invalidateDisplayItemClient(*box, invalidationReason); 1369 paintInvalidator.invalidateDisplayItemClient(*box, invalidationReason);
1370 } 1370 }
1371 1371
1372 } // namespace blink 1372 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutImage.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutListBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698