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

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

Issue 19098002: Introduce isHTMLHtmlElement and toHTMLHtmlElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 5 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
« no previous file with comments | « Source/core/page/TouchDisambiguation.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 16 matching lines...) Expand all
27 #include "core/rendering/RenderBox.h" 27 #include "core/rendering/RenderBox.h"
28 28
29 #include <math.h> 29 #include <math.h>
30 #include <algorithm> 30 #include <algorithm>
31 #include "HTMLNames.h" 31 #include "HTMLNames.h"
32 #include "core/dom/Document.h" 32 #include "core/dom/Document.h"
33 #include "core/dom/WebCoreMemoryInstrumentation.h" 33 #include "core/dom/WebCoreMemoryInstrumentation.h"
34 #include "core/editing/htmlediting.h" 34 #include "core/editing/htmlediting.h"
35 #include "core/html/HTMLElement.h" 35 #include "core/html/HTMLElement.h"
36 #include "core/html/HTMLFrameOwnerElement.h" 36 #include "core/html/HTMLFrameOwnerElement.h"
37 #include "core/html/HTMLHtmlElement.h"
37 #include "core/page/Frame.h" 38 #include "core/page/Frame.h"
38 #include "core/page/FrameView.h" 39 #include "core/page/FrameView.h"
39 #include "core/page/Page.h" 40 #include "core/page/Page.h"
40 #include "core/platform/graphics/FloatQuad.h" 41 #include "core/platform/graphics/FloatQuad.h"
41 #include "core/platform/graphics/GraphicsContextStateSaver.h" 42 #include "core/platform/graphics/GraphicsContextStateSaver.h"
42 #include "core/platform/graphics/transforms/TransformState.h" 43 #include "core/platform/graphics/transforms/TransformState.h"
43 #include "core/rendering/HitTestResult.h" 44 #include "core/rendering/HitTestResult.h"
44 #include "core/rendering/PaintInfo.h" 45 #include "core/rendering/PaintInfo.h"
45 #include "core/rendering/RenderBoxRegionInfo.h" 46 #include "core/rendering/RenderBoxRegionInfo.h"
46 #include "core/rendering/RenderFlexibleBox.h" 47 #include "core/rendering/RenderFlexibleBox.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 204
204 void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl e) 205 void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyl e)
205 { 206 {
206 s_hadOverflowClip = hasOverflowClip(); 207 s_hadOverflowClip = hasOverflowClip();
207 208
208 RenderStyle* oldStyle = style(); 209 RenderStyle* oldStyle = style();
209 if (oldStyle) { 210 if (oldStyle) {
210 // The background of the root element or the body element could propagat e up to 211 // The background of the root element or the body element could propagat e up to
211 // the canvas. Just dirty the entire canvas when our style changes subs tantially. 212 // the canvas. Just dirty the entire canvas when our style changes subs tantially.
212 if (diff >= StyleDifferenceRepaint && node() && 213 if (diff >= StyleDifferenceRepaint && node() &&
213 (node()->hasTagName(htmlTag) || node()->hasTagName(bodyTag))) { 214 (isHTMLHtmlElement(node()) || node()->hasTagName(bodyTag))) {
214 view()->repaint(); 215 view()->repaint();
215 216
216 if (oldStyle->hasEntirelyFixedBackground() != newStyle->hasEntirelyF ixedBackground()) 217 if (oldStyle->hasEntirelyFixedBackground() != newStyle->hasEntirelyF ixedBackground())
217 view()->compositor()->rootFixedBackgroundsChanged(); 218 view()->compositor()->rootFixedBackgroundsChanged();
218 } 219 }
219 220
220 // When a layout hint happens and an object's position style changes, we have to do a layout 221 // When a layout hint happens and an object's position style changes, we have to do a layout
221 // to dirty the render tree using the old position value now. 222 // to dirty the render tree using the old position value now.
222 if (diff == StyleDifferenceLayout && parent() && oldStyle->position() != newStyle->position()) { 223 if (diff == StyleDifferenceLayout && parent() && oldStyle->position() != newStyle->position()) {
223 markContainingBlocksForLayout(); 224 markContainingBlocksForLayout();
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 setFloating(!isOutOfFlowPositioned() && styleToUse->isFloating()); 342 setFloating(!isOutOfFlowPositioned() && styleToUse->isFloating());
342 343
343 // We also handle <body> and <html>, whose overflow applies to the viewport. 344 // We also handle <body> and <html>, whose overflow applies to the viewport.
344 if (styleToUse->overflowX() != OVISIBLE && !isRootObject && isRenderBlock()) { 345 if (styleToUse->overflowX() != OVISIBLE && !isRootObject && isRenderBlock()) {
345 bool boxHasOverflowClip = true; 346 bool boxHasOverflowClip = true;
346 if (isBody()) { 347 if (isBody()) {
347 // Overflow on the body can propagate to the viewport under the foll owing conditions. 348 // Overflow on the body can propagate to the viewport under the foll owing conditions.
348 // (1) The root element is <html>. 349 // (1) The root element is <html>.
349 // (2) We are the primary <body> (can be checked by looking at docum ent.body). 350 // (2) We are the primary <body> (can be checked by looking at docum ent.body).
350 // (3) The root element has visible overflow. 351 // (3) The root element has visible overflow.
351 if (document()->documentElement()->hasTagName(htmlTag) && 352 if (isHTMLHtmlElement(document()->documentElement())
352 document()->body() == node() && 353 && document()->body() == node()
353 document()->documentElement()->renderer()->style()->overflowX() == OVISIBLE) 354 && document()->documentElement()->renderer()->style()->overflowX () == OVISIBLE)
354 boxHasOverflowClip = false; 355 boxHasOverflowClip = false;
355 } 356 }
356 357
357 // Check for overflow clip. 358 // Check for overflow clip.
358 // It's sufficient to just check one direction, since it's illegal to ha ve visible on only one overflow value. 359 // It's sufficient to just check one direction, since it's illegal to ha ve visible on only one overflow value.
359 if (boxHasOverflowClip) { 360 if (boxHasOverflowClip) {
360 if (!s_hadOverflowClip) 361 if (!s_hadOverflowClip)
361 // Erase the overflow 362 // Erase the overflow
362 repaint(); 363 repaint();
363 setHasOverflowClip(); 364 setHasOverflowClip();
364 } 365 }
365 } 366 }
366 367
(...skipping 4279 matching lines...) Expand 10 before | Expand all | Expand 10 after
4646 4647
4647 void RenderBox::reportStaticMembersMemoryUsage(MemoryInstrumentation* memoryInst rumentation) 4648 void RenderBox::reportStaticMembersMemoryUsage(MemoryInstrumentation* memoryInst rumentation)
4648 { 4649 {
4649 memoryInstrumentation->addRootObject(gOverrideHeightMap, WebCoreMemoryTypes: :RenderingStructures); 4650 memoryInstrumentation->addRootObject(gOverrideHeightMap, WebCoreMemoryTypes: :RenderingStructures);
4650 memoryInstrumentation->addRootObject(gOverrideWidthMap, WebCoreMemoryTypes:: RenderingStructures); 4651 memoryInstrumentation->addRootObject(gOverrideWidthMap, WebCoreMemoryTypes:: RenderingStructures);
4651 memoryInstrumentation->addRootObject(gOverrideContainingBlockLogicalHeightMa p, WebCoreMemoryTypes::RenderingStructures); 4652 memoryInstrumentation->addRootObject(gOverrideContainingBlockLogicalHeightMa p, WebCoreMemoryTypes::RenderingStructures);
4652 memoryInstrumentation->addRootObject(gOverrideContainingBlockLogicalWidthMap , WebCoreMemoryTypes::RenderingStructures); 4653 memoryInstrumentation->addRootObject(gOverrideContainingBlockLogicalWidthMap , WebCoreMemoryTypes::RenderingStructures);
4653 } 4654 }
4654 4655
4655 } // namespace WebCore 4656 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/TouchDisambiguation.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698