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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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
« no previous file with comments | « Source/core/rendering/RenderQuote.cpp ('k') | Source/core/rendering/RenderReplaced.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) 2011 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } 202 }
203 203
204 void RenderRegion::checkRegionStyle() 204 void RenderRegion::checkRegionStyle()
205 { 205 {
206 ASSERT(m_flowThread); 206 ASSERT(m_flowThread);
207 bool customRegionStyle = false; 207 bool customRegionStyle = false;
208 208
209 // FIXME: Region styling doesn't work for pseudo elements. 209 // FIXME: Region styling doesn't work for pseudo elements.
210 if (node()) { 210 if (node()) {
211 Element* regionElement = toElement(node()); 211 Element* regionElement = toElement(node());
212 customRegionStyle = view()->document()->styleResolver()->checkRegionStyl e(regionElement); 212 customRegionStyle = view()->document().styleResolver()->checkRegionStyle (regionElement);
213 } 213 }
214 setHasCustomRegionStyle(customRegionStyle); 214 setHasCustomRegionStyle(customRegionStyle);
215 m_flowThread->checkRegionsWithStyling(); 215 m_flowThread->checkRegionsWithStyling();
216 } 216 }
217 217
218 void RenderRegion::incrementAutoLogicalHeightCount() 218 void RenderRegion::incrementAutoLogicalHeightCount()
219 { 219 {
220 ASSERT(isValid()); 220 ASSERT(isValid());
221 ASSERT(m_hasAutoLogicalHeight); 221 ASSERT(m_hasAutoLogicalHeight);
222 222
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 { 531 {
532 RenderBlock::willBeRemovedFromTree(); 532 RenderBlock::willBeRemovedFromTree();
533 533
534 detachRegion(); 534 detachRegion();
535 } 535 }
536 536
537 PassRefPtr<RenderStyle> RenderRegion::computeStyleInRegion(const RenderObject* o bject) 537 PassRefPtr<RenderStyle> RenderRegion::computeStyleInRegion(const RenderObject* o bject)
538 { 538 {
539 ASSERT(object); 539 ASSERT(object);
540 ASSERT(object->view()); 540 ASSERT(object->view());
541 ASSERT(object->view()->document());
542 ASSERT(!object->isAnonymous()); 541 ASSERT(!object->isAnonymous());
543 ASSERT(object->node() && object->node()->isElementNode()); 542 ASSERT(object->node() && object->node()->isElementNode());
544 543
545 // FIXME: Region styling fails for pseudo-elements because the renderers don 't have a node. 544 // FIXME: Region styling fails for pseudo-elements because the renderers don 't have a node.
546 Element* element = toElement(object->node()); 545 Element* element = toElement(object->node());
547 RefPtr<RenderStyle> renderObjectRegionStyle = object->view()->document()->st yleResolver()->styleForElement(element, 0, DisallowStyleSharing, MatchAllRules, this); 546 RefPtr<RenderStyle> renderObjectRegionStyle = object->view()->document().sty leResolver()->styleForElement(element, 0, DisallowStyleSharing, MatchAllRules, t his);
548 547
549 return renderObjectRegionStyle.release(); 548 return renderObjectRegionStyle.release();
550 } 549 }
551 550
552 void RenderRegion::computeChildrenStyleInRegion(const RenderObject* object) 551 void RenderRegion::computeChildrenStyleInRegion(const RenderObject* object)
553 { 552 {
554 for (RenderObject* child = object->firstChild(); child; child = child->nextS ibling()) { 553 for (RenderObject* child = object->firstChild(); child; child = child->nextS ibling()) {
555 554
556 RenderObjectRegionStyleMap::iterator it = m_renderObjectRegionStyle.find (child); 555 RenderObjectRegionStyleMap::iterator it = m_renderObjectRegionStyle.find (child);
557 556
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 645
647 LayoutUnit autoHeight = hasOverrideHeight() ? overrideLogicalContentHeight() : computedAutoHeight(); 646 LayoutUnit autoHeight = hasOverrideHeight() ? overrideLogicalContentHeight() : computedAutoHeight();
648 647
649 LayoutUnit newLogicalHeight = autoHeight + borderAndPaddingLogicalHeight(); 648 LayoutUnit newLogicalHeight = autoHeight + borderAndPaddingLogicalHeight();
650 ASSERT(newLogicalHeight < LayoutUnit::max() / 2); 649 ASSERT(newLogicalHeight < LayoutUnit::max() / 2);
651 if (newLogicalHeight > logicalHeight()) 650 if (newLogicalHeight > logicalHeight())
652 setLogicalHeight(newLogicalHeight); 651 setLogicalHeight(newLogicalHeight);
653 } 652 }
654 653
655 } // namespace WebCore 654 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderQuote.cpp ('k') | Source/core/rendering/RenderReplaced.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698