Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
REGRESSION(r109729) [Form] Rendering of select/optgroup/option combin…
…ation is too slow.

https://bugs.webkit.org/show_bug.cgi?id=88059

Reviewed by Kent Tamura.

This patch changes to share RenderStyle object among the "option"
elements to improve rendering performance and reducing memory usage
of RenderStyle.

No new tests. This patch doesn't change behavior but rendering performance.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithElement): Check attribute value
mismatching for "option" element.


Canonical link: https://commits.webkit.org/105892@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
yosinch committed Jun 1, 2012
1 parent 92afc1a commit 5101f4d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
17 changes: 17 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,20 @@
2012-06-01 Yoshifumi Inoue <yosin@chromium.org>

REGRESSION(r109729) [Form] Rendering of select/optgroup/option combination is too slow.
https://bugs.webkit.org/show_bug.cgi?id=88059

Reviewed by Kent Tamura.

This patch changes to share RenderStyle object among the "option"
elements to improve rendering performance and reducing memory usage
of RenderStyle.

No new tests. This patch doesn't change behavior but rendering performance.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithElement): Check attribute value
mismatching for "option" element.

2012-06-01 Alexander Pavlov <apavlov@chromium.org>

Web Inspector: [REGRESSION] Bad layout of "Override device metrics" controls in the Settings dialog
Expand Down
10 changes: 8 additions & 2 deletions Source/WebCore/css/StyleResolver.cpp
Expand Up @@ -1389,8 +1389,14 @@ bool StyleResolver::canShareStyleWithElement(StyledElement* element) const
}
#endif

if (element->hasTagName(optionTag))
return false;
// Check attributes for :disabled, :enabeld, :checked, :default, CSS pseudo class.
if (element->hasTagName(optionTag)) {
HTMLOptionElement* thisOptionElement = toHTMLOptionElement(element);
HTMLOptionElement* otherOptionElement = toHTMLOptionElement(m_element);
if (thisOptionElement->isEnabledFormControl() != otherOptionElement->isEnabledFormControl()
|| thisOptionElement->selected() != otherOptionElement->selected())
return false;
}

if (element->hasTagName(optgroupTag) && m_element->disabled() != element->disabled())
return false;
Expand Down

0 comments on commit 5101f4d

Please sign in to comment.