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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTableCell.h

Issue 2640143005: Support subpixel layout for borders. (Closed)
Patch Set: Created 3 years, 11 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) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2013 Apple Inc. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 int logicalHeightFromStyle() const { 150 int logicalHeightFromStyle() const {
151 Length height = style()->logicalHeight(); 151 Length height = style()->logicalHeight();
152 int styleLogicalHeight = height.isIntrinsicOrAuto() 152 int styleLogicalHeight = height.isIntrinsicOrAuto()
153 ? 0 153 ? 0
154 : valueForLength(height, LayoutUnit()).toInt(); 154 : valueForLength(height, LayoutUnit()).toInt();
155 155
156 // In strict mode, box-sizing: content-box do the right thing and actually 156 // In strict mode, box-sizing: content-box do the right thing and actually
157 // add in the border and padding. 157 // add in the border and padding.
158 // Call computedCSSPadding* directly to avoid including implicitPadding. 158 // Call computedCSSPadding* directly to avoid including implicitPadding.
159 if (!document().inQuirksMode() && 159 if (!document().inQuirksMode() &&
160 style()->boxSizing() != EBoxSizing::kBorderBox) 160 style()->boxSizing() != EBoxSizing::kBorderBox) {
161 styleLogicalHeight += 161 styleLogicalHeight +=
162 (computedCSSPaddingBefore() + computedCSSPaddingAfter()).floor() + 162 (computedCSSPaddingBefore() + computedCSSPaddingAfter()).floor() +
163 borderBefore() + borderAfter(); 163 (borderBefore() + borderAfter()).floor();
164 }
164 return styleLogicalHeight; 165 return styleLogicalHeight;
165 } 166 }
166 167
167 int logicalHeightForRowSizing() const { 168 int logicalHeightForRowSizing() const {
168 // FIXME: This function does too much work, and is very hot during table 169 // FIXME: This function does too much work, and is very hot during table
169 // layout! 170 // layout!
170 int adjustedLogicalHeight = 171 int adjustedLogicalHeight =
171 pixelSnappedLogicalHeight() - 172 pixelSnappedLogicalHeight() -
172 (intrinsicPaddingBefore() + intrinsicPaddingAfter()); 173 (intrinsicPaddingBefore() + intrinsicPaddingAfter());
173 int styleLogicalHeight = logicalHeightFromStyle(); 174 int styleLogicalHeight = logicalHeightFromStyle();
174 return max(styleLogicalHeight, adjustedLogicalHeight); 175 return max(styleLogicalHeight, adjustedLogicalHeight);
175 } 176 }
176 177
177 void setCellLogicalWidth(int constrainedLogicalWidth, SubtreeLayoutScope&); 178 void setCellLogicalWidth(int constrainedLogicalWidth, SubtreeLayoutScope&);
178 179
179 int borderLeft() const override; 180 LayoutUnit borderLeft() const override;
180 int borderRight() const override; 181 LayoutUnit borderRight() const override;
181 int borderTop() const override; 182 LayoutUnit borderTop() const override;
182 int borderBottom() const override; 183 LayoutUnit borderBottom() const override;
183 int borderStart() const override; 184 LayoutUnit borderStart() const override;
184 int borderEnd() const override; 185 LayoutUnit borderEnd() const override;
185 int borderBefore() const override; 186 LayoutUnit borderBefore() const override;
186 int borderAfter() const override; 187 LayoutUnit borderAfter() const override;
187 188
188 void collectBorderValues(LayoutTable::CollapsedBorderValues&); 189 void collectBorderValues(LayoutTable::CollapsedBorderValues&);
189 static void sortBorderValues(LayoutTable::CollapsedBorderValues&); 190 static void sortBorderValues(LayoutTable::CollapsedBorderValues&);
190 191
191 void layout() override; 192 void layout() override;
192 193
193 void paint(const PaintInfo&, const LayoutPoint&) const override; 194 void paint(const PaintInfo&, const LayoutPoint&) const override;
194 195
195 int cellBaselinePosition() const; 196 int cellBaselinePosition() const;
196 bool isBaselineAligned() const { 197 bool isBaselineAligned() const {
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 371
371 void updateLogicalWidth() override; 372 void updateLogicalWidth() override;
372 373
373 void paintBoxDecorationBackground(const PaintInfo&, 374 void paintBoxDecorationBackground(const PaintInfo&,
374 const LayoutPoint&) const override; 375 const LayoutPoint&) const override;
375 void paintMask(const PaintInfo&, const LayoutPoint&) const override; 376 void paintMask(const PaintInfo&, const LayoutPoint&) const override;
376 377
377 LayoutSize offsetFromContainer(const LayoutObject*) const override; 378 LayoutSize offsetFromContainer(const LayoutObject*) const override;
378 LayoutRect localVisualRect() const override; 379 LayoutRect localVisualRect() const override;
379 380
380 int borderHalfLeft(bool outer) const; 381 LayoutUnit borderHalfLeft(bool outer) const;
381 int borderHalfRight(bool outer) const; 382 LayoutUnit borderHalfRight(bool outer) const;
382 int borderHalfTop(bool outer) const; 383 LayoutUnit borderHalfTop(bool outer) const;
383 int borderHalfBottom(bool outer) const; 384 LayoutUnit borderHalfBottom(bool outer) const;
384 385
385 int borderHalfStart(bool outer) const; 386 LayoutUnit borderHalfStart(bool outer) const;
386 int borderHalfEnd(bool outer) const; 387 LayoutUnit borderHalfEnd(bool outer) const;
387 int borderHalfBefore(bool outer) const; 388 LayoutUnit borderHalfBefore(bool outer) const;
388 int borderHalfAfter(bool outer) const; 389 LayoutUnit borderHalfAfter(bool outer) const;
389 390
390 void setIntrinsicPaddingBefore(int p) { m_intrinsicPaddingBefore = p; } 391 void setIntrinsicPaddingBefore(int p) { m_intrinsicPaddingBefore = p; }
391 void setIntrinsicPaddingAfter(int p) { m_intrinsicPaddingAfter = p; } 392 void setIntrinsicPaddingAfter(int p) { m_intrinsicPaddingAfter = p; }
392 void setIntrinsicPadding(int before, int after) { 393 void setIntrinsicPadding(int before, int after) {
393 setIntrinsicPaddingBefore(before); 394 setIntrinsicPaddingBefore(before);
394 setIntrinsicPaddingAfter(after); 395 setIntrinsicPaddingAfter(after);
395 } 396 }
396 397
397 bool hasStartBorderAdjoiningTable() const; 398 bool hasStartBorderAdjoiningTable() const;
398 bool hasEndBorderAdjoiningTable() const; 399 bool hasEndBorderAdjoiningTable() const;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 return toLayoutTableCell(firstChild()); 470 return toLayoutTableCell(firstChild());
470 } 471 }
471 472
472 inline LayoutTableCell* LayoutTableRow::lastCell() const { 473 inline LayoutTableCell* LayoutTableRow::lastCell() const {
473 return toLayoutTableCell(lastChild()); 474 return toLayoutTableCell(lastChild());
474 } 475 }
475 476
476 } // namespace blink 477 } // namespace blink
477 478
478 #endif // LayoutTableCell_h 479 #endif // LayoutTableCell_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698