| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 bool seenTextTrackContainer = false; | 61 bool seenTextTrackContainer = false; |
| 62 #endif | 62 #endif |
| 63 for (LayoutObject* child = m_children.lastChild(); child; | 63 for (LayoutObject* child = m_children.lastChild(); child; |
| 64 child = child->previousSibling()) { | 64 child = child->previousSibling()) { |
| 65 #if DCHECK_IS_ON() | 65 #if DCHECK_IS_ON() |
| 66 if (child->node()->isMediaControls()) | 66 if (child->node()->isMediaControls()) |
| 67 ASSERT(!seenTextTrackContainer); | 67 ASSERT(!seenTextTrackContainer); |
| 68 else if (child->node()->isTextTrackContainer()) | 68 else if (child->node()->isTextTrackContainer()) |
| 69 seenTextTrackContainer = true; | 69 seenTextTrackContainer = true; |
| 70 else | 70 else |
| 71 ASSERT_NOT_REACHED(); | 71 NOTREACHED(); |
| 72 #endif | 72 #endif |
| 73 | 73 |
| 74 // TODO(mlamouri): we miss some layouts because needsLayout returns false in | 74 // TODO(mlamouri): we miss some layouts because needsLayout returns false in |
| 75 // some cases where we want to change the width of the controls because the | 75 // some cases where we want to change the width of the controls because the |
| 76 // visible viewport has changed for example. | 76 // visible viewport has changed for example. |
| 77 if (newRect.size() == oldSize && !child->needsLayout()) | 77 if (newRect.size() == oldSize && !child->needsLayout()) |
| 78 continue; | 78 continue; |
| 79 | 79 |
| 80 LayoutUnit width = newRect.width(); | 80 LayoutUnit width = newRect.width(); |
| 81 if (child->node()->isMediaControls()) { | 81 if (child->node()->isMediaControls()) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 .x()); | 153 .x()); |
| 154 const LayoutUnit newWidth = visibleWidth - absoluteXOffset; | 154 const LayoutUnit newWidth = visibleWidth - absoluteXOffset; |
| 155 | 155 |
| 156 if (newWidth < 0) | 156 if (newWidth < 0) |
| 157 return mediaRect.width(); | 157 return mediaRect.width(); |
| 158 | 158 |
| 159 return std::min(mediaRect.width(), visibleWidth - absoluteXOffset); | 159 return std::min(mediaRect.width(), visibleWidth - absoluteXOffset); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace blink | 162 } // namespace blink |
| OLD | NEW |