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

Side by Side Diff: sky/engine/core/rendering/RenderBox.cpp

Issue 761283002: Remove webkit-line-clamp (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years 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 * (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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 } 284 }
285 285
286 void RenderBox::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignmen t& alignX, const ScrollAlignment& alignY) 286 void RenderBox::scrollRectToVisible(const LayoutRect& rect, const ScrollAlignmen t& alignX, const ScrollAlignment& alignY)
287 { 287 {
288 // Presumably the same issue as in setScrollTop. See crbug.com/343132. 288 // Presumably the same issue as in setScrollTop. See crbug.com/343132.
289 DisableCompositingQueryAsserts disabler; 289 DisableCompositingQueryAsserts disabler;
290 290
291 RenderBox* parentBox = 0; 291 RenderBox* parentBox = 0;
292 LayoutRect newRect = rect; 292 LayoutRect newRect = rect;
293 293
294 bool restrictedByLineClamp = false;
295 if (parent()) { 294 if (parent()) {
296 parentBox = parent()->enclosingBox(); 295 parentBox = parent()->enclosingBox();
297 restrictedByLineClamp = !parent()->style()->lineClamp().isNone();
298 } 296 }
299 297
300 if (hasOverflowClip() && !restrictedByLineClamp) { 298 if (hasOverflowClip()) {
301 // Don't scroll to reveal an overflow layer that is restricted by the -w ebkit-line-clamp property. 299 // Don't scroll to reveal an overflow layer that is restricted by the -w ebkit-line-clamp property.
302 // This will prevent us from revealing text hidden by the slider in Safa ri RSS. 300 // This will prevent us from revealing text hidden by the slider in Safa ri RSS.
303 newRect = layer()->scrollableArea()->exposeRect(rect, alignX, alignY); 301 newRect = layer()->scrollableArea()->exposeRect(rect, alignX, alignY);
304 } 302 }
305 303
306 if (frame()->page()->autoscrollController().autoscrollInProgress()) 304 if (frame()->page()->autoscrollController().autoscrollInProgress())
307 parentBox = enclosingScrollableBox(); 305 parentBox = enclosingScrollableBox();
308 306
309 if (parentBox) 307 if (parentBox)
310 parentBox->scrollRectToVisible(newRect, alignX, alignY); 308 parentBox->scrollRectToVisible(newRect, alignX, alignY);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 } 467 }
470 468
471 return renderer && renderer->isBox() ? toRenderBox(renderer) : 0; 469 return renderer && renderer->isBox() ? toRenderBox(renderer) : 0;
472 } 470 }
473 471
474 void RenderBox::scrollByRecursively(const IntSize& delta, ScrollOffsetClamping c lamp) 472 void RenderBox::scrollByRecursively(const IntSize& delta, ScrollOffsetClamping c lamp)
475 { 473 {
476 if (delta.isZero()) 474 if (delta.isZero())
477 return; 475 return;
478 476
479 bool restrictedByLineClamp = false; 477 if (hasOverflowClip()) {
480 if (parent())
481 restrictedByLineClamp = !parent()->style()->lineClamp().isNone();
482
483 if (hasOverflowClip() && !restrictedByLineClamp) {
484 IntSize newScrollOffset = layer()->scrollableArea()->adjustedScrollOffse t() + delta; 478 IntSize newScrollOffset = layer()->scrollableArea()->adjustedScrollOffse t() + delta;
485 layer()->scrollableArea()->scrollToOffset(newScrollOffset, clamp); 479 layer()->scrollableArea()->scrollToOffset(newScrollOffset, clamp);
486 480
487 // If this layer can't do the scroll we ask the next layer up that can s croll to try 481 // If this layer can't do the scroll we ask the next layer up that can s croll to try
488 IntSize remainingScrollOffset = newScrollOffset - layer()->scrollableAre a()->adjustedScrollOffset(); 482 IntSize remainingScrollOffset = newScrollOffset - layer()->scrollableAre a()->adjustedScrollOffset();
489 if (!remainingScrollOffset.isZero() && parent()) { 483 if (!remainingScrollOffset.isZero() && parent()) {
490 if (RenderBox* scrollableBox = enclosingScrollableBox()) 484 if (RenderBox* scrollableBox = enclosingScrollableBox())
491 scrollableBox->scrollByRecursively(remainingScrollOffset, clamp) ; 485 scrollableBox->scrollByRecursively(remainingScrollOffset, clamp) ;
492 486
493 LocalFrame* frame = this->frame(); 487 LocalFrame* frame = this->frame();
(...skipping 3001 matching lines...) Expand 10 before | Expand all | Expand 10 after
3495 3489
3496 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 3490 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
3497 { 3491 {
3498 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); 3492 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor);
3499 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 3493 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
3500 ASSERT(hasBackground == style.hasBackground()); 3494 ASSERT(hasBackground == style.hasBackground());
3501 hasBorder = style.hasBorder(); 3495 hasBorder = style.hasBorder();
3502 } 3496 }
3503 3497
3504 } // namespace blink 3498 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698