<?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>150982</bug_id>
          
          <creation_ts>2015-11-06 16:00:17 -0800</creation_ts>
          <short_desc>Web Inspector: Add View.prototype.contentElement, to protect the &quot;private&quot; part of the view&apos;s DOM</short_desc>
          <delta_ts>2026-01-12 09:08:29 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>151126</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Matt Baker">mattbaker</reporter>
          <assigned_to name="Matt Baker">mattbaker</assigned_to>
          <cc>graouts</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1140085</commentid>
    <comment_count>0</comment_count>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2015-11-06 16:00:17 -0800</bug_when>
    <thetext>* SUMMARY
Add View.prototype.contentElement, to protect the &quot;private&quot; part of the view&apos;s DOM. There are two advantages to doing this:

1) Views with scrollbars and other chrome cannot be broken by a subclass naively calling this.element.removeChildren().
2) The view&apos;s root element, and the element to which subviews and other elements are added by subclasses and other clients are not always the same.

Proposal:

1) A new contentElement property will be added to View. It will be the logical container to which subviews and other DOM elements are added. View&apos;s implicit contract guarantees that DOM mutations can safely be done to contentElement without breaking other parts of the view.
2) View.prototype.element will remain the view&apos;s root DOM element. It is appended to the parent view&apos;s contentElement, and may be styled by subclasses and other clients (as is currently the case).
3) A view begins life with element === contentElement. It&apos;s the responsibility of each subclass to create a separate contentElement, if needed.
4) Each class in a view&apos;s hierarchy may have a different contentElement. This is an implementation detail used by addSubview and friends. To view clients there is a single contentElement, which is that of the most derived class.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1149095</commentid>
    <comment_count>1</comment_count>
    <who name="Matt Baker">mattbaker</who>
    <bug_when>2015-12-14 13:49:52 -0800</bug_when>
    <thetext>Building this functionality into class View might be overkill. For the following cases it&apos;s straightforward to just create a &quot;contentView&quot; with a public getter:

- TimelineOverivew: graphContainerElement (fixed in https://webkit.org/b/152235)
- SidebarPanel: contentElement -&gt; contentView
- DetailsSection: contentElement -&gt; contentView
- ScrollableView: will need a content view to hide scrollbars, etc, from derived classes and view clients.
- Popovers</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1149096</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-12-14 13:50:15 -0800</bug_when>
    <thetext>&lt;rdar://problem/23888254&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>