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

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

Issue 16599003: :hover style not applied on hover if its display property is different from original style's (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch (fixed test that was expected to fail and is now passing) Created 7 years, 6 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 | « Source/core/html/HTMLOptionElement.h ('k') | Source/core/html/HTMLPlugInElement.h » ('j') | 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) 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 if (!value.isNull()) 81 if (!value.isNull())
82 element->setValue(value); 82 element->setValue(value);
83 if (defaultSelected) 83 if (defaultSelected)
84 element->setAttribute(selectedAttr, emptyAtom); 84 element->setAttribute(selectedAttr, emptyAtom);
85 element->setSelected(selected); 85 element->setSelected(selected);
86 86
87 return element.release(); 87 return element.release();
88 } 88 }
89 89
90 void HTMLOptionElement::attach() 90 void HTMLOptionElement::attach(const AttachContext& context)
91 { 91 {
92 HTMLElement::attach(); 92 HTMLElement::attach(context);
93 // If after attaching nothing called styleForRenderer() on this node we 93 // If after attaching nothing called styleForRenderer() on this node we
94 // manually cache the value. This happens if our parent doesn't have a 94 // manually cache the value. This happens if our parent doesn't have a
95 // renderer like <optgroup> or if it doesn't allow children like <select>. 95 // renderer like <optgroup> or if it doesn't allow children like <select>.
96 if (!m_style && parentNode()->renderStyle()) 96 if (!m_style && parentNode()->renderStyle())
97 updateNonRenderStyle(); 97 updateNonRenderStyle();
98 } 98 }
99 99
100 void HTMLOptionElement::detach() 100 void HTMLOptionElement::detach(const AttachContext& context)
101 { 101 {
102 m_style.clear(); 102 m_style.clear();
103 HTMLElement::detach(); 103 HTMLElement::detach(context);
104 } 104 }
105 105
106 bool HTMLOptionElement::supportsFocus() const 106 bool HTMLOptionElement::supportsFocus() const
107 { 107 {
108 return HTMLElement::supportsFocus(); 108 return HTMLElement::supportsFocus();
109 } 109 }
110 110
111 bool HTMLOptionElement::isFocusable() const 111 bool HTMLOptionElement::isFocusable() const
112 { 112 {
113 // Option elements do not have a renderer so we check the renderStyle instea d. 113 // Option elements do not have a renderer so we check the renderStyle instea d.
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 398
399 const HTMLOptionElement* toHTMLOptionElement(const Node* node) 399 const HTMLOptionElement* toHTMLOptionElement(const Node* node)
400 { 400 {
401 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(optionTag)); 401 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->hasTagName(optionTag));
402 return static_cast<const HTMLOptionElement*>(node); 402 return static_cast<const HTMLOptionElement*>(node);
403 } 403 }
404 404
405 #endif 405 #endif
406 406
407 } // namespace 407 } // namespace
OLDNEW
« no previous file with comments | « Source/core/html/HTMLOptionElement.h ('k') | Source/core/html/HTMLPlugInElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698