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

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 476223003: Use tighter typing for Document::ownerElement() return value (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 parentBox = parent()->enclosingBox(); 461 parentBox = parent()->enclosingBox();
462 restrictedByLineClamp = !parent()->style()->lineClamp().isNone(); 462 restrictedByLineClamp = !parent()->style()->lineClamp().isNone();
463 } 463 }
464 464
465 if (hasOverflowClip() && !restrictedByLineClamp) { 465 if (hasOverflowClip() && !restrictedByLineClamp) {
466 // Don't scroll to reveal an overflow layer that is restricted by the -w ebkit-line-clamp property. 466 // Don't scroll to reveal an overflow layer that is restricted by the -w ebkit-line-clamp property.
467 // This will prevent us from revealing text hidden by the slider in Safa ri RSS. 467 // This will prevent us from revealing text hidden by the slider in Safa ri RSS.
468 newRect = layer()->scrollableArea()->exposeRect(rect, alignX, alignY); 468 newRect = layer()->scrollableArea()->exposeRect(rect, alignX, alignY);
469 } else if (!parentBox && canBeProgramaticallyScrolled()) { 469 } else if (!parentBox && canBeProgramaticallyScrolled()) {
470 if (FrameView* frameView = this->frameView()) { 470 if (FrameView* frameView = this->frameView()) {
471 Element* ownerElement = document().ownerElement(); 471 HTMLFrameOwnerElement* ownerElement = document().ownerElement();
472 472
473 if (ownerElement && ownerElement->renderer()) { 473 if (ownerElement && ownerElement->renderer()) {
474 HTMLFrameElementBase* frameElementBase = 0; 474 HTMLFrameElementBase* frameElementBase = isHTMLFrameElementBase( *ownerElement) ? toHTMLFrameElementBase(ownerElement) : 0;
475
476 if (isHTMLFrameElement(*ownerElement) || isHTMLIFrameElement(*ow nerElement))
477 frameElementBase = toHTMLFrameElementBase(ownerElement);
478
479 if (frameElementAndViewPermitScroll(frameElementBase, frameView) ) { 475 if (frameElementAndViewPermitScroll(frameElementBase, frameView) ) {
480 LayoutRect viewRect = frameView->visibleContentRect(); 476 LayoutRect viewRect = frameView->visibleContentRect();
481 LayoutRect exposeRect = ScrollAlignment::getRectToExpose(vie wRect, rect, alignX, alignY); 477 LayoutRect exposeRect = ScrollAlignment::getRectToExpose(vie wRect, rect, alignX, alignY);
482 478
483 int xOffset = roundToInt(exposeRect.x()); 479 int xOffset = roundToInt(exposeRect.x());
484 int yOffset = roundToInt(exposeRect.y()); 480 int yOffset = roundToInt(exposeRect.y());
485 // Adjust offsets if they're outside of the allowable range. 481 // Adjust offsets if they're outside of the allowable range.
486 xOffset = std::max(0, std::min(frameView->contentsWidth(), x Offset)); 482 xOffset = std::max(0, std::min(frameView->contentsWidth(), x Offset));
487 yOffset = std::max(0, std::min(frameView->contentsHeight(), yOffset)); 483 yOffset = std::max(0, std::min(frameView->contentsHeight(), yOffset));
488 484
(...skipping 4209 matching lines...) Expand 10 before | Expand all | Expand 10 after
4698 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 4694 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
4699 { 4695 {
4700 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); 4696 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor);
4701 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 4697 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
4702 ASSERT(hasBackground == style.hasBackground()); 4698 ASSERT(hasBackground == style.hasBackground());
4703 hasBorder = style.hasBorder(); 4699 hasBorder = style.hasBorder();
4704 hasAppearance = style.hasAppearance(); 4700 hasAppearance = style.hasAppearance();
4705 } 4701 }
4706 4702
4707 } // namespace blink 4703 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorDOMAgent.cpp ('k') | Source/core/rendering/RenderBoxModelObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698