| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
| 3 * rights reserved. |
| 3 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 4 * Copyright (C) 2012 Samsung Electronics. All rights reserved. | 5 * Copyright (C) 2012 Samsung Electronics. All rights reserved. |
| 5 * | 6 * |
| 6 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| 10 * | 11 * |
| 11 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 if (!m_useFallbackContent) | 244 if (!m_useFallbackContent) |
| 244 return; | 245 return; |
| 245 m_useFallbackContent = false; | 246 m_useFallbackContent = false; |
| 246 if (ShadowRoot* root = element().userAgentShadowRoot()) | 247 if (ShadowRoot* root = element().userAgentShadowRoot()) |
| 247 root->removeChildren(); | 248 root->removeChildren(); |
| 248 createShadowSubtree(); | 249 createShadowSubtree(); |
| 249 reattachFallbackContent(); | 250 reattachFallbackContent(); |
| 250 } | 251 } |
| 251 | 252 |
| 252 void ImageInputType::reattachFallbackContent() { | 253 void ImageInputType::reattachFallbackContent() { |
| 253 // This can happen inside of attachLayoutTree() in the middle of a recalcStyle
so we need to | 254 // This can happen inside of attachLayoutTree() in the middle of a recalcStyle |
| 254 // reattach synchronously here. | 255 // so we need to reattach synchronously here. |
| 255 if (element().document().inStyleRecalc()) | 256 if (element().document().inStyleRecalc()) |
| 256 element().reattachLayoutTree(); | 257 element().reattachLayoutTree(); |
| 257 else | 258 else |
| 258 element().lazyReattachIfAttached(); | 259 element().lazyReattachIfAttached(); |
| 259 } | 260 } |
| 260 | 261 |
| 261 void ImageInputType::createShadowSubtree() { | 262 void ImageInputType::createShadowSubtree() { |
| 262 if (!m_useFallbackContent) { | 263 if (!m_useFallbackContent) { |
| 263 BaseButtonInputType::createShadowSubtree(); | 264 BaseButtonInputType::createShadowSubtree(); |
| 264 return; | 265 return; |
| 265 } | 266 } |
| 266 HTMLImageFallbackHelper::createAltTextShadowTree(element()); | 267 HTMLImageFallbackHelper::createAltTextShadowTree(element()); |
| 267 } | 268 } |
| 268 | 269 |
| 269 PassRefPtr<ComputedStyle> ImageInputType::customStyleForLayoutObject( | 270 PassRefPtr<ComputedStyle> ImageInputType::customStyleForLayoutObject( |
| 270 PassRefPtr<ComputedStyle> newStyle) { | 271 PassRefPtr<ComputedStyle> newStyle) { |
| 271 if (!m_useFallbackContent) | 272 if (!m_useFallbackContent) |
| 272 return newStyle; | 273 return newStyle; |
| 273 | 274 |
| 274 return HTMLImageFallbackHelper::customStyleForAltText(element(), | 275 return HTMLImageFallbackHelper::customStyleForAltText(element(), |
| 275 std::move(newStyle)); | 276 std::move(newStyle)); |
| 276 } | 277 } |
| 277 | 278 |
| 278 } // namespace blink | 279 } // namespace blink |
| OLD | NEW |