| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 { | 249 { |
| 250 if (hasOverflowClip()) | 250 if (hasOverflowClip()) |
| 251 return layer()->scrollableArea()->scrollHeight(); | 251 return layer()->scrollableArea()->scrollHeight(); |
| 252 // For objects with visible overflow, this matches IE. | 252 // For objects with visible overflow, this matches IE. |
| 253 // FIXME: Need to work right with writing modes. | 253 // FIXME: Need to work right with writing modes. |
| 254 return snapSizeToPixel(scrollHeight(), y() + clientTop()); | 254 return snapSizeToPixel(scrollHeight(), y() + clientTop()); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void RenderBox::setScrollLeft(LayoutUnit newLeft) | 257 void RenderBox::setScrollLeft(LayoutUnit newLeft) |
| 258 { | 258 { |
| 259 // This doesn't hit in any tests, but since the equivalent code in setScroll
Top | |
| 260 // does, presumably this code does as well. | |
| 261 DisableCompositingQueryAsserts disabler; | |
| 262 | |
| 263 if (hasOverflowClip()) | 259 if (hasOverflowClip()) |
| 264 layer()->scrollableArea()->scrollToXOffset(newLeft, ScrollOffsetClamped)
; | 260 layer()->scrollableArea()->scrollToXOffset(newLeft, ScrollOffsetClamped)
; |
| 265 } | 261 } |
| 266 | 262 |
| 267 void RenderBox::setScrollTop(LayoutUnit newTop) | 263 void RenderBox::setScrollTop(LayoutUnit newTop) |
| 268 { | 264 { |
| 269 // Hits in compositing/overflow/do-not-assert-on-invisible-composited-layers
.html | |
| 270 DisableCompositingQueryAsserts disabler; | |
| 271 | |
| 272 if (hasOverflowClip()) | 265 if (hasOverflowClip()) |
| 273 layer()->scrollableArea()->scrollToYOffset(newTop, ScrollOffsetClamped); | 266 layer()->scrollableArea()->scrollToYOffset(newTop, ScrollOffsetClamped); |
| 274 } | 267 } |
| 275 | 268 |
| 276 void RenderBox::scrollToOffset(const IntSize& offset) | 269 void RenderBox::scrollToOffset(const IntSize& offset) |
| 277 { | 270 { |
| 278 ASSERT(hasOverflowClip()); | 271 ASSERT(hasOverflowClip()); |
| 279 | |
| 280 // This doesn't hit in any tests, but since the equivalent code in setScroll
Top | |
| 281 // does, presumably this code does as well. | |
| 282 DisableCompositingQueryAsserts disabler; | |
| 283 layer()->scrollableArea()->scrollToOffset(offset, ScrollOffsetClamped); | 272 layer()->scrollableArea()->scrollToOffset(offset, ScrollOffsetClamped); |
| 284 } | 273 } |
| 285 | 274 |
| 286 void RenderBox::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignmen
t& alignX, const ScrollAlignment& alignY) | 275 void RenderBox::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignmen
t& alignX, const ScrollAlignment& alignY) |
| 287 { | 276 { |
| 288 // Presumably the same issue as in setScrollTop. See crbug.com/343132. | |
| 289 DisableCompositingQueryAsserts disabler; | |
| 290 | |
| 291 RenderBox* parentBox = 0; | 277 RenderBox* parentBox = 0; |
| 292 LayoutRect newRect = rect; | 278 LayoutRect newRect = rect; |
| 293 | 279 |
| 294 if (parent()) { | 280 if (parent()) { |
| 295 parentBox = parent()->enclosingBox(); | 281 parentBox = parent()->enclosingBox(); |
| 296 } | 282 } |
| 297 | 283 |
| 298 if (hasOverflowClip()) { | 284 if (hasOverflowClip()) { |
| 299 // Don't scroll to reveal an overflow layer that is restricted by the -w
ebkit-line-clamp property. | 285 // Don't scroll to reveal an overflow layer that is restricted by the -w
ebkit-line-clamp property. |
| 300 // This will prevent us from revealing text hidden by the slider in Safa
ri RSS. | 286 // This will prevent us from revealing text hidden by the slider in Safa
ri RSS. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 } | 357 } |
| 372 | 358 |
| 373 void RenderBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& add
itionalOffset, const RenderLayerModelObject*) const | 359 void RenderBox::addFocusRingRects(Vector<IntRect>& rects, const LayoutPoint& add
itionalOffset, const RenderLayerModelObject*) const |
| 374 { | 360 { |
| 375 if (!size().isEmpty()) | 361 if (!size().isEmpty()) |
| 376 rects.append(pixelSnappedIntRect(additionalOffset, size())); | 362 rects.append(pixelSnappedIntRect(additionalOffset, size())); |
| 377 } | 363 } |
| 378 | 364 |
| 379 bool RenderBox::scroll(ScrollDirection direction, ScrollGranularity granularity,
float delta) | 365 bool RenderBox::scroll(ScrollDirection direction, ScrollGranularity granularity,
float delta) |
| 380 { | 366 { |
| 381 // Presumably the same issue as in setScrollTop. See crbug.com/343132. | |
| 382 DisableCompositingQueryAsserts disabler; | |
| 383 if (!layer() || !layer()->scrollableArea()) | 367 if (!layer() || !layer()->scrollableArea()) |
| 384 return false; | 368 return false; |
| 385 return layer()->scrollableArea()->scroll(direction, granularity, delta); | 369 return layer()->scrollableArea()->scroll(direction, granularity, delta); |
| 386 } | 370 } |
| 387 | 371 |
| 388 bool RenderBox::canBeScrolledAndHasScrollableArea() const | 372 bool RenderBox::canBeScrolledAndHasScrollableArea() const |
| 389 { | 373 { |
| 390 return canBeProgramaticallyScrolled() && (pixelSnappedScrollHeight() != pixe
lSnappedClientHeight() || pixelSnappedScrollWidth() != pixelSnappedClientWidth()
); | 374 return canBeProgramaticallyScrolled() && (pixelSnappedScrollHeight() != pixe
lSnappedClientHeight() || pixelSnappedScrollWidth() != pixelSnappedClientWidth()
); |
| 391 } | 375 } |
| 392 | 376 |
| (...skipping 3059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3452 | 3436 |
| 3453 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 3437 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
| 3454 { | 3438 { |
| 3455 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); | 3439 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); |
| 3456 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 3440 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
| 3457 ASSERT(hasBackground == style.hasBackground()); | 3441 ASSERT(hasBackground == style.hasBackground()); |
| 3458 hasBorder = style.hasBorder(); | 3442 hasBorder = style.hasBorder(); |
| 3459 } | 3443 } |
| 3460 | 3444 |
| 3461 } // namespace blink | 3445 } // namespace blink |
| OLD | NEW |