| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 LayoutRect newRect = contentBoxRect(); | 53 LayoutRect newRect = contentBoxRect(); |
| 54 | 54 |
| 55 LayoutState state(*this); | 55 LayoutState state(*this); |
| 56 | 56 |
| 57 Optional<LayoutUnit> newPanelWidth; | 57 Optional<LayoutUnit> newPanelWidth; |
| 58 | 58 |
| 59 // Iterate the children in reverse order so that the media controls are laid | 59 // Iterate the children in reverse order so that the media controls are laid |
| 60 // out before the text track container. This is to ensure that the text | 60 // out before the text track container. This is to ensure that the text |
| 61 // track rendering has an up-to-date position of the media controls for | 61 // track rendering has an up-to-date position of the media controls for |
| 62 // overlap checking, see LayoutVTTCue. | 62 // overlap checking, see LayoutVTTCue. |
| 63 #if ENABLE(ASSERT) | 63 #if DCHECK_IS_ON() |
| 64 bool seenTextTrackContainer = false; | 64 bool seenTextTrackContainer = false; |
| 65 #endif | 65 #endif |
| 66 for (LayoutObject* child = m_children.lastChild(); child; | 66 for (LayoutObject* child = m_children.lastChild(); child; |
| 67 child = child->previousSibling()) { | 67 child = child->previousSibling()) { |
| 68 #if ENABLE(ASSERT) | 68 #if DCHECK_IS_ON() |
| 69 if (child->node()->isMediaControls()) | 69 if (child->node()->isMediaControls()) |
| 70 ASSERT(!seenTextTrackContainer); | 70 ASSERT(!seenTextTrackContainer); |
| 71 else if (child->node()->isTextTrackContainer()) | 71 else if (child->node()->isTextTrackContainer()) |
| 72 seenTextTrackContainer = true; | 72 seenTextTrackContainer = true; |
| 73 else | 73 else |
| 74 ASSERT_NOT_REACHED(); | 74 ASSERT_NOT_REACHED(); |
| 75 #endif | 75 #endif |
| 76 | 76 |
| 77 // TODO(mlamouri): we miss some layouts because needsLayout returns false in | 77 // TODO(mlamouri): we miss some layouts because needsLayout returns false in |
| 78 // some cases where we want to change the width of the controls because the | 78 // some cases where we want to change the width of the controls because the |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 .x()); | 164 .x()); |
| 165 const LayoutUnit newWidth = visibleWidth - absoluteXOffset; | 165 const LayoutUnit newWidth = visibleWidth - absoluteXOffset; |
| 166 | 166 |
| 167 if (newWidth < 0) | 167 if (newWidth < 0) |
| 168 return mediaRect.width(); | 168 return mediaRect.width(); |
| 169 | 169 |
| 170 return std::min(mediaRect.width(), visibleWidth - absoluteXOffset); | 170 return std::min(mediaRect.width(), visibleWidth - absoluteXOffset); |
| 171 } | 171 } |
| 172 | 172 |
| 173 } // namespace blink | 173 } // namespace blink |
| OLD | NEW |