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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutVideo.cpp

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-revert the previous and check position:fixed in layout code. Created 4 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
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 if (!parent) 203 if (!parent)
204 return nullptr; 204 return nullptr;
205 205
206 LayoutFullScreen* fullScreen = parent->isLayoutFullScreen() ? toLayoutFullSc reen(parent) : 0; 206 LayoutFullScreen* fullScreen = parent->isLayoutFullScreen() ? toLayoutFullSc reen(parent) : 0;
207 if (!fullScreen) 207 if (!fullScreen)
208 return nullptr; 208 return nullptr;
209 209
210 return fullScreen->placeholder(); 210 return fullScreen->placeholder();
211 } 211 }
212 212
213 LayoutUnit LayoutVideo::offsetLeft() const 213 LayoutUnit LayoutVideo::offsetLeft(const Element* parent) const
214 { 214 {
215 if (const LayoutBlock* block = layoutObjectPlaceholder(this)) 215 if (const LayoutBlock* block = layoutObjectPlaceholder(this))
216 return block->offsetLeft(); 216 return block->offsetLeft(parent);
217 return LayoutMedia::offsetLeft(); 217 return LayoutMedia::offsetLeft(parent);
218 } 218 }
219 219
220 LayoutUnit LayoutVideo::offsetTop() const 220 LayoutUnit LayoutVideo::offsetTop(const Element* parent) const
221 { 221 {
222 if (const LayoutBlock* block = layoutObjectPlaceholder(this)) 222 if (const LayoutBlock* block = layoutObjectPlaceholder(this))
223 return block->offsetTop(); 223 return block->offsetTop(parent);
224 return LayoutMedia::offsetTop(); 224 return LayoutMedia::offsetTop(parent);
225 } 225 }
226 226
227 LayoutUnit LayoutVideo::offsetWidth() const 227 LayoutUnit LayoutVideo::offsetWidth() const
228 { 228 {
229 if (const LayoutBlock* block = layoutObjectPlaceholder(this)) 229 if (const LayoutBlock* block = layoutObjectPlaceholder(this))
230 return block->offsetWidth(); 230 return block->offsetWidth();
231 return LayoutMedia::offsetWidth(); 231 return LayoutMedia::offsetWidth();
232 } 232 }
233 233
234 LayoutUnit LayoutVideo::offsetHeight() const 234 LayoutUnit LayoutVideo::offsetHeight() const
235 { 235 {
236 if (const LayoutBlock* block = layoutObjectPlaceholder(this)) 236 if (const LayoutBlock* block = layoutObjectPlaceholder(this))
237 return block->offsetHeight(); 237 return block->offsetHeight();
238 return LayoutMedia::offsetHeight(); 238 return LayoutMedia::offsetHeight();
239 } 239 }
240 240
241 CompositingReasons LayoutVideo::additionalCompositingReasons() const 241 CompositingReasons LayoutVideo::additionalCompositingReasons() const
242 { 242 {
243 HTMLMediaElement* element = toHTMLMediaElement(node()); 243 HTMLMediaElement* element = toHTMLMediaElement(node());
244 if (element->isFullscreen() && element->usesOverlayFullscreenVideo()) 244 if (element->isFullscreen() && element->usesOverlayFullscreenVideo())
245 return CompositingReasonVideo; 245 return CompositingReasonVideo;
246 246
247 if (shouldDisplayVideo() && supportsAcceleratedRendering()) 247 if (shouldDisplayVideo() && supportsAcceleratedRendering())
248 return CompositingReasonVideo; 248 return CompositingReasonVideo;
249 249
250 return CompositingReasonNone; 250 return CompositingReasonNone;
251 } 251 }
252 252
253 } // namespace blink 253 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698