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

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

Issue 2640143005: Support subpixel layout for borders. (Closed)
Patch Set: Rebaselined tests. Created 3 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 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 LayoutRect frameRect() const { return m_frameRect; } 357 LayoutRect frameRect() const { return m_frameRect; }
358 void setFrameRect(const LayoutRect& rect) { 358 void setFrameRect(const LayoutRect& rect) {
359 setLocation(rect.location()); 359 setLocation(rect.location());
360 setSize(rect.size()); 360 setSize(rect.size());
361 } 361 }
362 362
363 // Note that those functions have their origin at this box's CSS border box. 363 // Note that those functions have their origin at this box's CSS border box.
364 // As such their location doesn't account for 'top'/'left'. 364 // As such their location doesn't account for 'top'/'left'.
365 LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); } 365 LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); }
366 LayoutRect paddingBoxRect() const { 366 LayoutRect paddingBoxRect() const {
367 return LayoutRect(LayoutUnit(borderLeft()), LayoutUnit(borderTop()), 367 return LayoutRect(borderLeft(), borderTop(), clientWidth(), clientHeight());
368 clientWidth(), clientHeight());
369 } 368 }
370 IntRect pixelSnappedBorderBoxRect() const { 369 IntRect pixelSnappedBorderBoxRect() const {
371 return IntRect(IntPoint(), m_frameRect.pixelSnappedSize()); 370 return IntRect(IntPoint(), m_frameRect.pixelSnappedSize());
372 } 371 }
373 IntRect borderBoundingBox() const final { 372 IntRect borderBoundingBox() const final {
374 return pixelSnappedBorderBoxRect(); 373 return pixelSnappedBorderBoxRect();
375 } 374 }
376 375
377 // The content area of the box (excludes padding - and intrinsic padding for 376 // The content area of the box (excludes padding - and intrinsic padding for
378 // table cells, etc... - and border). 377 // table cells, etc... - and border).
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 518
520 // More IE extensions. clientWidth and clientHeight represent the interior of 519 // More IE extensions. clientWidth and clientHeight represent the interior of
521 // an object excluding border and scrollbar. clientLeft/Top are just the 520 // an object excluding border and scrollbar. clientLeft/Top are just the
522 // borderLeftWidth and borderTopWidth. 521 // borderLeftWidth and borderTopWidth.
523 DISABLE_CFI_PERF LayoutUnit clientLeft() const { 522 DISABLE_CFI_PERF LayoutUnit clientLeft() const {
524 return LayoutUnit(borderLeft() + 523 return LayoutUnit(borderLeft() +
525 (shouldPlaceBlockDirectionScrollbarOnLogicalLeft() 524 (shouldPlaceBlockDirectionScrollbarOnLogicalLeft()
526 ? verticalScrollbarWidth() 525 ? verticalScrollbarWidth()
527 : 0)); 526 : 0));
528 } 527 }
529 DISABLE_CFI_PERF LayoutUnit clientTop() const { 528 DISABLE_CFI_PERF LayoutUnit clientTop() const { return borderTop(); }
530 return LayoutUnit(borderTop());
531 }
532 LayoutUnit clientWidth() const; 529 LayoutUnit clientWidth() const;
533 LayoutUnit clientHeight() const; 530 LayoutUnit clientHeight() const;
534 DISABLE_CFI_PERF LayoutUnit clientLogicalWidth() const { 531 DISABLE_CFI_PERF LayoutUnit clientLogicalWidth() const {
535 return style()->isHorizontalWritingMode() ? clientWidth() : clientHeight(); 532 return style()->isHorizontalWritingMode() ? clientWidth() : clientHeight();
536 } 533 }
537 DISABLE_CFI_PERF LayoutUnit clientLogicalHeight() const { 534 DISABLE_CFI_PERF LayoutUnit clientLogicalHeight() const {
538 return style()->isHorizontalWritingMode() ? clientHeight() : clientWidth(); 535 return style()->isHorizontalWritingMode() ? clientHeight() : clientWidth();
539 } 536 }
540 DISABLE_CFI_PERF LayoutUnit clientLogicalBottom() const { 537 DISABLE_CFI_PERF LayoutUnit clientLogicalBottom() const {
541 return borderBefore() + clientLogicalHeight(); 538 return borderBefore() + clientLogicalHeight();
(...skipping 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after
1632 1629
1633 inline bool LayoutBox::isForcedFragmentainerBreakValue(EBreak breakValue) { 1630 inline bool LayoutBox::isForcedFragmentainerBreakValue(EBreak breakValue) {
1634 return breakValue == BreakColumn || breakValue == BreakLeft || 1631 return breakValue == BreakColumn || breakValue == BreakLeft ||
1635 breakValue == BreakPage || breakValue == BreakRecto || 1632 breakValue == BreakPage || breakValue == BreakRecto ||
1636 breakValue == BreakRight || breakValue == BreakVerso; 1633 breakValue == BreakRight || breakValue == BreakVerso;
1637 } 1634 }
1638 1635
1639 } // namespace blink 1636 } // namespace blink
1640 1637
1641 #endif // LayoutBox_h 1638 #endif // LayoutBox_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBoxModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698