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

Side by Side Diff: Source/core/layout/LayoutMedia.cpp

Issue 1018593004: Implement <video controls> dodging for text track layout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: braces Created 5 years, 9 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/html/track/TextTrackContainer.cpp ('k') | Source/core/layout/LayoutVTTCue.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) 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 void LayoutMedia::layout() 50 void LayoutMedia::layout()
51 { 51 {
52 LayoutSize oldSize = contentBoxRect().size(); 52 LayoutSize oldSize = contentBoxRect().size();
53 53
54 LayoutImage::layout(); 54 LayoutImage::layout();
55 55
56 LayoutSize newSize = contentBoxRect().size(); 56 LayoutSize newSize = contentBoxRect().size();
57 57
58 LayoutState state(*this, locationOffset()); 58 LayoutState state(*this, locationOffset());
59 59
60 for (LayoutObject* child = m_children.firstChild(); child; child = child->ne xtSibling()) { 60 // Iterate the children in reverse order so that the media controls are laid
61 ASSERT(child->node()->isMediaControls() || child->node()->isTextTrackCon tainer()); 61 // out before the text track container. This is to ensure that the text
62 // track rendering has an up-to-date position of the media controls for
63 // overlap checking, see LayoutVTTCue.
64 #if ENABLE(ASSERT)
65 bool seenTextTrackContainer = false;
66 #endif
67 for (LayoutObject* child = m_children.lastChild(); child; child = child->pre viousSibling()) {
68 #if ENABLE(ASSERT)
69 if (child->node()->isMediaControls())
70 ASSERT(!seenTextTrackContainer);
71 else if (child->node()->isTextTrackContainer())
72 seenTextTrackContainer = true;
73 else
74 ASSERT_NOT_REACHED();
75 #endif
62 76
63 if (newSize == oldSize && !child->needsLayout()) 77 if (newSize == oldSize && !child->needsLayout())
64 continue; 78 continue;
65 79
66 LayoutBox* layoutBox = toLayoutBox(child); 80 LayoutBox* layoutBox = toLayoutBox(child);
67 layoutBox->setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSi ze(paddingLeft(), paddingTop())); 81 layoutBox->setLocation(LayoutPoint(borderLeft(), borderTop()) + LayoutSi ze(paddingLeft(), paddingTop()));
68 // TODO(philipj): Remove the mutableStyleRef() and depend on CSS 82 // TODO(philipj): Remove the mutableStyleRef() and depend on CSS
69 // width/height: inherit to match the media element size. 83 // width/height: inherit to match the media element size.
70 layoutBox->mutableStyleRef().setHeight(Length(newSize.height(), Fixed)); 84 layoutBox->mutableStyleRef().setHeight(Length(newSize.height(), Fixed));
71 layoutBox->mutableStyleRef().setWidth(Length(newSize.width(), Fixed)); 85 layoutBox->mutableStyleRef().setWidth(Length(newSize.width(), Fixed));
(...skipping 22 matching lines...) Expand all
94 return true; 108 return true;
95 109
96 return false; 110 return false;
97 } 111 }
98 112
99 void LayoutMedia::paintReplaced(const PaintInfo&, const LayoutPoint&) 113 void LayoutMedia::paintReplaced(const PaintInfo&, const LayoutPoint&)
100 { 114 {
101 } 115 }
102 116
103 } // namespace blink 117 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/track/TextTrackContainer.cpp ('k') | Source/core/layout/LayoutVTTCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698