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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/ImageInputType.cpp

Issue 1732753004: ImageInputType::ensurePrimaryContent should recreate UA shadow tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp ('k') | no next file » | 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) 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 r ights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 4 * Copyright (C) 2012 Samsung Electronics. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if (ShadowRoot* root = element().userAgentShadowRoot()) 264 if (ShadowRoot* root = element().userAgentShadowRoot())
265 root->removeChildren(); 265 root->removeChildren();
266 createShadowSubtree(); 266 createShadowSubtree();
267 } 267 }
268 268
269 void ImageInputType::ensurePrimaryContent() 269 void ImageInputType::ensurePrimaryContent()
270 { 270 {
271 if (!m_useFallbackContent) 271 if (!m_useFallbackContent)
272 return; 272 return;
273 m_useFallbackContent = false; 273 m_useFallbackContent = false;
274 if (ShadowRoot* root = element().userAgentShadowRoot())
275 root->removeChildren();
276 createShadowSubtree();
274 reattachFallbackContent(); 277 reattachFallbackContent();
275 } 278 }
276 279
277 void ImageInputType::reattachFallbackContent() 280 void ImageInputType::reattachFallbackContent()
278 { 281 {
279 // This can happen inside of attach() in the middle of a recalcStyle so we n eed to 282 // This can happen inside of attach() in the middle of a recalcStyle so we n eed to
280 // reattach synchronously here. 283 // reattach synchronously here.
281 if (element().document().inStyleRecalc()) 284 if (element().document().inStyleRecalc())
282 element().reattach(); 285 element().reattach();
283 else 286 else
(...skipping 11 matching lines...) Expand all
295 298
296 PassRefPtr<ComputedStyle> ImageInputType::customStyleForLayoutObject(PassRefPtr< ComputedStyle> newStyle) 299 PassRefPtr<ComputedStyle> ImageInputType::customStyleForLayoutObject(PassRefPtr< ComputedStyle> newStyle)
297 { 300 {
298 if (!m_useFallbackContent) 301 if (!m_useFallbackContent)
299 return newStyle; 302 return newStyle;
300 303
301 return HTMLImageFallbackHelper::customStyleForAltText(element(), newStyle); 304 return HTMLImageFallbackHelper::customStyleForAltText(element(), newStyle);
302 } 305 }
303 306
304 } // namespace blink 307 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLInputElementTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698