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

Side by Side Diff: Source/core/html/HTMLOptionElement.cpp

Issue 165433002: Recalc OPTION and OPTGROUP from recalcOwnStyle. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 5 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2010 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 Google Inc. All rights reserved.
8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved. 8 * Copyright (C) 2011 Motorola Mobility, Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 m_style = originalStyleForRenderer(); 289 m_style = originalStyleForRenderer();
290 } 290 }
291 291
292 RenderStyle* HTMLOptionElement::nonRendererStyle() const 292 RenderStyle* HTMLOptionElement::nonRendererStyle() const
293 { 293 {
294 return m_style.get(); 294 return m_style.get();
295 } 295 }
296 296
297 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer() 297 PassRefPtr<RenderStyle> HTMLOptionElement::customStyleForRenderer()
298 { 298 {
299 if (!needsAttach())
300 updateNonRenderStyle();
rune 2014/02/13 23:57:35 Possibly, updateNonRenderStyle can be called uncon
esprehn 2014/02/14 00:46:20 I'm inclined to say we do that. This has been a so
rune 2014/02/14 09:42:08 Done.
299 return m_style; 301 return m_style;
300 } 302 }
301 303
302 void HTMLOptionElement::willRecalcStyle(StyleRecalcChange change) 304 void HTMLOptionElement::didRecalcStyle(StyleRecalcChange change)
303 { 305 {
304 if (!needsAttach() && (needsStyleRecalc() || change >= Inherit)) 306 if (change == NoChange)
305 updateNonRenderStyle(); 307 return;
306 }
307 308
308 void HTMLOptionElement::didRecalcStyle(StyleRecalcChange) 309 // FIXME: We ask our owner select to repaint regardless of which property ch anged.
309 {
310 // FIXME: This is nasty, we ask our owner select to repaint even if the new
311 // style is exactly the same.
312 if (HTMLSelectElement* select = ownerSelectElement()) { 310 if (HTMLSelectElement* select = ownerSelectElement()) {
313 if (RenderObject* renderer = select->renderer()) 311 if (RenderObject* renderer = select->renderer())
314 renderer->repaint(); 312 renderer->repaint();
315 } 313 }
316 } 314 }
317 315
318 String HTMLOptionElement::textIndentedToRespectGroupLabel() const 316 String HTMLOptionElement::textIndentedToRespectGroupLabel() const
319 { 317 {
320 ContainerNode* parent = parentNode(); 318 ContainerNode* parent = parentNode();
321 if (parent && parent->hasTagName(optgroupTag)) 319 if (parent && parent->hasTagName(optgroupTag))
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 363
366 HTMLFormElement* HTMLOptionElement::form() const 364 HTMLFormElement* HTMLOptionElement::form() const
367 { 365 {
368 if (HTMLSelectElement* selectElement = ownerSelectElement()) 366 if (HTMLSelectElement* selectElement = ownerSelectElement())
369 return selectElement->formOwner(); 367 return selectElement->formOwner();
370 368
371 return 0; 369 return 0;
372 } 370 }
373 371
374 } // namespace WebCore 372 } // namespace WebCore
OLDNEW
« Source/core/html/HTMLOptGroupElement.cpp ('K') | « Source/core/html/HTMLOptionElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698