<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>87694</bug_id>
          
          <creation_ts>2012-05-28 22:42:07 -0700</creation_ts>
          <short_desc>[CSS] Move StyleResolver::canShareStyleWithElement to StyledElement as virtual method</short_desc>
          <delta_ts>2022-07-13 15:33:07 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>80381</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter>yosin</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>eric</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>635585</commentid>
    <comment_count>0</comment_count>
    <who name="">yosin</who>
    <bug_when>2012-05-28 22:42:07 -0700</bug_when>
    <thetext>I would like to move StyleResolver::canShareStyleWithElement to StyleElement class as virtual method.
The reasons are:

1. Move hasTagName checking to class which implements element. This also removes some #if, e.g. ENABLE(PROGRESS_TAG)
2. Control sharing in fine grain, e.g. if (element-&gt;hasTagName(optionTag)) return false is too conservative.



Call site changes are:

inline StyledElement* StyleResolver::findSiblingForStyleSharing(Node* node, unsigned&amp; count) const
{
    for (; node; node = node-&gt;previousSibling()) {
        if (!node-&gt;isStyledElement())
            continue;
NOW:    if (canShareStyleWithElement(static_cast&lt;StyledElement*&gt;(node)))
NEW:    if (m_element-&gt;canShareStyleWithElement(static_cast&lt;StyledElement*&gt;(node))) 
            break;
   ....
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>861836</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2013-03-22 14:16:45 -0700</bug_when>
    <thetext>canShareStyleWith is an insanity-hot function.  I do not recommend this approach, unless you&apos;re finding ways to avoid calling it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883418</commentid>
    <comment_count>2</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-13 15:33:07 -0700</bug_when>
    <thetext>This code has been significantly refactored since this patch was proposed. There doesn&apos;t seem to be any action we can take here.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>