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

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

Issue 889563002: Make RenderObject::style() return a const object (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Blind fix for Mac. Created 5 years, 10 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) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return; 64 return;
65 65
66 bool controlsNeedLayout = controlsRenderer->needsLayout(); 66 bool controlsNeedLayout = controlsRenderer->needsLayout();
67 LayoutSize newSize = contentBoxRect().size(); 67 LayoutSize newSize = contentBoxRect().size();
68 if (newSize == oldSize && !controlsNeedLayout) 68 if (newSize == oldSize && !controlsNeedLayout)
69 return; 69 return;
70 70
71 LayoutState state(*this, locationOffset()); 71 LayoutState state(*this, locationOffset());
72 72
73 controlsRenderer->setLocation(LayoutPoint(borderLeft(), borderTop()) + Layou tSize(paddingLeft(), paddingTop())); 73 controlsRenderer->setLocation(LayoutPoint(borderLeft(), borderTop()) + Layou tSize(paddingLeft(), paddingTop()));
74 controlsRenderer->style()->setHeight(Length(newSize.height(), Fixed)); 74 controlsRenderer->deprecatedMutableStyle()->setHeight(Length(newSize.height( ), Fixed));
75 controlsRenderer->style()->setWidth(Length(newSize.width(), Fixed)); 75 controlsRenderer->deprecatedMutableStyle()->setWidth(Length(newSize.width(), Fixed));
76 controlsRenderer->forceLayout(); 76 controlsRenderer->forceLayout();
77 clearNeedsLayout(); 77 clearNeedsLayout();
78 } 78 }
79 79
80 bool RenderMedia::isChildAllowed(RenderObject* child, RenderStyle*) const 80 bool RenderMedia::isChildAllowed(RenderObject* child, const RenderStyle*) const
81 { 81 {
82 // The only allowed child is the media controls. The user agent stylesheet 82 // The only allowed child is the media controls. The user agent stylesheet
83 // (mediaControls.css) has ::-webkit-media-controls { display: flex; }. If 83 // (mediaControls.css) has ::-webkit-media-controls { display: flex; }. If
84 // author style sets display: inline we would get an inline renderer as a 84 // author style sets display: inline we would get an inline renderer as a
85 // child of replaced content, which is not supposed to be possible. This 85 // child of replaced content, which is not supposed to be possible. This
86 // check can be removed if ::-webkit-media-controls is made internal. 86 // check can be removed if ::-webkit-media-controls is made internal.
87 return child->isFlexibleBox(); 87 return child->isFlexibleBox();
88 } 88 }
89 89
90 void RenderMedia::paintReplaced(const PaintInfo&, const LayoutPoint&) 90 void RenderMedia::paintReplaced(const PaintInfo&, const LayoutPoint&)
91 { 91 {
92 } 92 }
93 93
94 } // namespace blink 94 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698