OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2054 } | 2054 } |
2055 } | 2055 } |
2056 | 2056 |
2057 return resultLayer; | 2057 return resultLayer; |
2058 } | 2058 } |
2059 | 2059 |
2060 LayoutRect PaintLayer::boxForClipPath() const | 2060 LayoutRect PaintLayer::boxForClipPath() const |
2061 { | 2061 { |
2062 if (!layoutObject()->isBox()) { | 2062 if (!layoutObject()->isBox()) { |
2063 SECURITY_DCHECK(layoutObject()->isLayoutInline()); | 2063 SECURITY_DCHECK(layoutObject()->isLayoutInline()); |
2064 return toLayoutInline(layoutObject())->linesBoundingBox(); | 2064 const LayoutInline& layoutInline = toLayoutInline(*layoutObject()); |
| 2065 // This somewhat convoluted computation matches what Gecko does. |
| 2066 // See crbug.com/641907. |
| 2067 LayoutRect inlineBBox = layoutInline.linesBoundingBox(); |
| 2068 const InlineFlowBox* flowBox = layoutInline.firstLineBox(); |
| 2069 inlineBBox.setHeight(flowBox ? flowBox->frameRect().height() : LayoutUni
t(0)); |
| 2070 return inlineBBox; |
2065 } | 2071 } |
2066 return toLayoutBox(layoutObject())->borderBoxRect(); | 2072 return toLayoutBox(layoutObject())->borderBoxRect(); |
2067 } | 2073 } |
2068 | 2074 |
2069 bool PaintLayer::hitTestClippedOutByClipPath(PaintLayer* rootLayer, const HitTes
tLocation& hitTestLocation) const | 2075 bool PaintLayer::hitTestClippedOutByClipPath(PaintLayer* rootLayer, const HitTes
tLocation& hitTestLocation) const |
2070 { | 2076 { |
2071 if (!layoutObject()->hasClipPath()) | 2077 if (!layoutObject()->hasClipPath()) |
2072 return false; | 2078 return false; |
2073 DCHECK(isSelfPaintingLayer()); | 2079 DCHECK(isSelfPaintingLayer()); |
2074 DCHECK(rootLayer); | 2080 DCHECK(rootLayer); |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2948 | 2954 |
2949 void showLayerTree(const blink::LayoutObject* layoutObject) | 2955 void showLayerTree(const blink::LayoutObject* layoutObject) |
2950 { | 2956 { |
2951 if (!layoutObject) { | 2957 if (!layoutObject) { |
2952 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2958 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2953 return; | 2959 return; |
2954 } | 2960 } |
2955 showLayerTree(layoutObject->enclosingLayer()); | 2961 showLayerTree(layoutObject->enclosingLayer()); |
2956 } | 2962 } |
2957 #endif | 2963 #endif |
OLD | NEW |