OLD | NEW |
---|---|
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 Loading... | |
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; | |
philipj_slow
2015/03/20 05:58:19
What do you think, way overkill? If you prefer I c
fs
2015/03/20 09:58:54
I don't mind that much, but it does give the impre
philipj_slow
2015/03/20 16:46:33
Yeah, it's ugly alright. I've tinkered a bit on a
| |
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 layoutBox->style()->setHeight(Length(newSize.height(), Fixed)); | 82 layoutBox->style()->setHeight(Length(newSize.height(), Fixed)); |
69 layoutBox->style()->setWidth(Length(newSize.width(), Fixed)); | 83 layoutBox->style()->setWidth(Length(newSize.width(), Fixed)); |
70 layoutBox->forceLayout(); | 84 layoutBox->forceLayout(); |
71 } | 85 } |
(...skipping 20 matching lines...) Expand all Loading... | |
92 return true; | 106 return true; |
93 | 107 |
94 return false; | 108 return false; |
95 } | 109 } |
96 | 110 |
97 void LayoutMedia::paintReplaced(const PaintInfo&, const LayoutPoint&) | 111 void LayoutMedia::paintReplaced(const PaintInfo&, const LayoutPoint&) |
98 { | 112 { |
99 } | 113 } |
100 | 114 |
101 } // namespace blink | 115 } // namespace blink |
OLD | NEW |