Bug 103925 - Style sharing: Allow sharing between elements with classes not referenced by any selectors.
Summary: Style sharing: Allow sharing between elements with classes not referenced by ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-03 14:01 PST by Andreas Kling
Modified: 2012-12-04 20:10 PST (History)
1 user (show)

See Also:


Attachments
Patch (7.57 KB, patch)
2012-12-03 14:34 PST, Andreas Kling
buildbot: commit-queue-
Details | Formatted Diff | Diff
Patch (7.90 KB, patch)
2012-12-04 19:03 PST, Andreas Kling
no flags Details | Formatted Diff | Diff
Patch (7.61 KB, patch)
2012-12-04 19:04 PST, Andreas Kling
koivisto: review+
koivisto: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2012-12-03 14:01:04 PST
<div class="foo"> and <div> should be allowed to share style if there are no style rules with a ".foo" selector.
Comment 1 Andreas Kling 2012-12-03 14:34:41 PST
Created attachment 177334 [details]
Patch
Comment 2 Build Bot 2012-12-03 15:12:30 PST
Comment on attachment 177334 [details]
Patch

Attachment 177334 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15105660

New failing tests:
compositing/iframes/invisible-nested-iframe-hide.html
css1/basic/class_as_selector.html
compositing/images/clip-on-directly-composited-image.html
canvas/philip/tests/2d.drawImage.negativeSourceHeightAndWidth.html
css1/color_and_background/color.html
css1/box_properties/border_bottom.html
css1/basic/grouping.html
css1/box_properties/border_bottom_width.html
css1/box_properties/border_bottom_width_inline.html
css1/classification/white_space.html
css1/basic/inheritance.html
css1/box_properties/border.html
css1/color_and_background/background_position.html
canvas/philip/tests/2d.drawImage.negativeSourceHeight2.html
canvas/philip/tests/2d.composite.operation.foobar.html
css1/cascade/cascade_order.html
css1/color_and_background/background.html
css1/conformance/forward_compatible_parsing.html
compositing/images/direct-image-background-color.html
css1/color_and_background/background_color.html
css1/basic/containment.html
canvas/philip/tests/2d.clearRect+fillRect.alpha0.5.html
css1/basic/comments.html
css1/color_and_background/background_repeat.html
css1/font_properties/font.html
compositing/color-matching/image-color-matching.html
canvas/philip/tests/2d.clearRect+fillRect.basic.html
css1/classification/display.html
canvas/philip/tests/2d.drawImage.negativeSourceHeight.html
css1/classification/list_style_type.html
Comment 3 Andreas Kling 2012-12-04 19:03:28 PST
Created attachment 177646 [details]
Patch
Comment 4 Andreas Kling 2012-12-04 19:04:23 PST
Created attachment 177647 [details]
Patch
Comment 5 Antti Koivisto 2012-12-04 19:36:50 PST
Comment on attachment 177647 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=177647&action=review

> Source/WebCore/css/StyleResolver.cpp:967
> +        m_elementAffectedByClassRules = m_element && m_element->hasClass() && classNamesAffectedByRules(m_element->classNames());

We should really factor the style sharing code differently so using StyleResolver member for passing things around wouldn't be needed. Better done separately though.
Comment 6 Antti Koivisto 2012-12-04 19:46:28 PST
Comment on attachment 177647 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=177647&action=review

>> Source/WebCore/css/StyleResolver.cpp:967
>>          m_elementLinkState = m_checker.determineLinkState(m_element);
>> +        m_elementAffectedByClassRules = m_element && m_element->hasClass() && classNamesAffectedByRules(m_element->classNames());
> 
> We should really factor the style sharing code differently so using StyleResolver member for passing things around wouldn't be needed. Better done separately though.

This should probably be set in locateSharedStyle instead of initElement. That's the only case where it is needed.
Comment 7 Andreas Kling 2012-12-04 20:10:22 PST
Committed r136615: <http://trac.webkit.org/changeset/136615>