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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>22697</bug_id>
          
          <creation_ts>2013-07-16 17:24:08 +0000</creation_ts>
          <short_desc>API to detect palpable content, so you can tell in an editor if a paragraph is empty</short_desc>
          <delta_ts>2017-07-21 10:55:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Needs Impl Interest</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ian &apos;Hixie&apos; Hickson">ian</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>90807</commentid>
    <comment_count>0</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-07-16 17:24:08 +0000</bug_when>
    <thetext>On Wed, 5 Sep 2012, Ojan Vafai wrote:
&gt; On Wed, Aug 29, 2012 at 4:27 PM, Ian Hickson &lt;ian@hixie.ch&gt; wrote:
&gt; &gt; On Sun, 17 Jun 2012, Aryeh Gregor wrote:
&gt; &gt; &gt;
&gt; &gt; &gt; If you type some stuff and then delete it all, the desired result
&gt; &gt; &gt; will vary based on lots of factors, e.g.:
&gt; &gt; &gt;
&gt; &gt; &gt; * Whether &lt;div&gt; or &lt;p&gt; is being used for paragraph separators.
&gt; &gt; &gt; Both &lt;p&gt;&lt;br&gt;&lt;/p&gt; and &lt;div&gt;&lt;br&gt;&lt;/div&gt; might make sense for &quot;nothing&quot;,
&gt; &gt; &gt; depending.  This is author-configurable using the
&gt; &gt; &gt; defaultParagraphSeparator command.
&gt; &gt; &gt;
&gt; &gt; &gt; * Whether there was any styling present before.  If all the text was
&gt; &gt; &gt; previously bold, for instance, deleting everything might result in
&gt; &gt; &gt; something like &lt;p&gt;&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;/p&gt;, because per spec, deletion
&gt; &gt; &gt; doesn&apos;t remove style tags from empty lines.
&gt; &gt; &gt;
&gt; &gt; &gt; * Whether there was any other special markup.  If something (like
&gt; &gt; &gt; execCommand(&quot;insertHTML&quot;)) made the first line have &lt;p id=&quot;foo&quot;&gt;,
&gt; &gt; &gt; then deleting everything would result in &lt;p id=&quot;foo&quot;&gt;&lt;br&gt;&lt;/p&gt;.
&gt; &gt; &gt;
&gt; &gt; &gt; * What the author specified as the initial contents of the editable
&gt; &gt; &gt; area.  If you have &lt;div contenteditable&gt;&lt;br&gt;&lt;/div&gt; to start with,
&gt; &gt; &gt; and the user puts the cursor there and then types &quot;foo&quot; and then
&gt; &gt; &gt; deletes it, you&apos;ll go back to having just &lt;br&gt;, because nothing ever
&gt; &gt; &gt; inserted a &lt;p&gt; or &lt;div&gt; or anything.  (As soon as the user hits
&gt; &gt; &gt; Enter, both the old and new lines are wrapped in a paragraph
&gt; &gt; &gt; separator per spec, although only IE/Opera do this right now.)
&gt; &gt; &gt;
&gt; &gt; &gt; Really, you can have any HTML markup at all in contenteditable, and
&gt; &gt; &gt; we can&apos;t avoid that.  There&apos;s not going to be any reliable way to
&gt; &gt; &gt; figure out what &quot;nothing&quot; is if you can&apos;t answer the same question
&gt; &gt; &gt; for arbitrary HTML.
&gt; &gt;
&gt; &gt; Maybe the right way to detect &quot;nothing&quot; is to compare textContent
&gt; &gt; against &quot;&quot; and then to look for specific elements that count as
&gt; &gt; palpable content, like &lt;img&gt;. Would it make sense to provide an API
&gt; &gt; for that?
&gt;
&gt; Seems reasonable to me. That&apos;s the trickiest part of making this work
&gt; from script. If you had an API for this, hooking focus/blur events is
&gt; pretty straightforward. If, in the end, we still decide to add
&gt; placeholder, it will just use this API anyways.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128752</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2017-07-21 10:55:16 +0000</bug_when>
    <thetext>If this is still desired, please file a new issue at https://github.com/whatwg/html/issues/new.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>