OLD | NEW |
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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 bool isRootObject = isRoot(); | 324 bool isRootObject = isRoot(); |
325 bool isViewObject = isRenderView(); | 325 bool isViewObject = isRenderView(); |
326 | 326 |
327 // The root and the RenderView always paint their backgrounds/borders. | 327 // The root and the RenderView always paint their backgrounds/borders. |
328 if (isRootObject || isViewObject) | 328 if (isRootObject || isViewObject) |
329 setHasBoxDecorations(true); | 329 setHasBoxDecorations(true); |
330 | 330 |
331 setFloating(!isOutOfFlowPositioned() && styleToUse->isFloating()); | 331 setFloating(!isOutOfFlowPositioned() && styleToUse->isFloating()); |
332 | 332 |
333 bool boxHasOverflowClip = false; | 333 bool boxHasOverflowClip = false; |
334 // We also handle <body> and <html>, whose overflow applies to the viewport. | 334 if (!styleToUse->isOverflowVisible() && isRenderBlock() && !isViewObject) { |
335 if (!styleToUse->isOverflowVisible() && !isRootObject && isRenderBlock()) { | 335 // If overflow has been propagated to the viewport, it has no effect her
e. |
336 // Overflow on the body can propagate to the viewport under the followin
g conditions. | 336 if (node() != document().viewportDefiningElement()) { |
337 // (1) The root element is <html>. | |
338 // (2) We are the primary <body> (can be checked by looking at document.
body). | |
339 // (3) The root element has visible overflow. | |
340 if (isBody() && document().documentElement()->hasTagName(htmlTag) | |
341 && document().body() == node() | |
342 && document().documentElement()->renderer()->style()->isOverflowVisi
ble()) { | |
343 boxHasOverflowClip = false; | |
344 } else { | |
345 boxHasOverflowClip = true; | 337 boxHasOverflowClip = true; |
346 if (!hasOverflowClip()) { | 338 if (!hasOverflowClip()) { |
347 // If we are getting an overflow clip, preemptively erase any ov
erflowing content. | 339 // If we are getting an overflow clip, preemptively erase any ov
erflowing content. |
348 // FIXME: This should probably consult RenderOverflow. | 340 // FIXME: This should probably consult RenderOverflow. |
349 repaint(); | 341 repaint(); |
350 } | 342 } |
351 } | 343 } |
352 } | 344 } |
353 setHasOverflowClip(boxHasOverflowClip); | 345 setHasOverflowClip(boxHasOverflowClip); |
354 | 346 |
(...skipping 4561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4916 return 0; | 4908 return 0; |
4917 | 4909 |
4918 if (!layoutState && !flowThreadContainingBlock()) | 4910 if (!layoutState && !flowThreadContainingBlock()) |
4919 return 0; | 4911 return 0; |
4920 | 4912 |
4921 RenderBlock* containerBlock = containingBlock(); | 4913 RenderBlock* containerBlock = containingBlock(); |
4922 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4914 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4923 } | 4915 } |
4924 | 4916 |
4925 } // namespace WebCore | 4917 } // namespace WebCore |
OLD | NEW |