<?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>15522</bug_id>
          
          <creation_ts>2012-01-11 16:10:46 +0000</creation_ts>
          <short_desc>Add execCommand() to Element</short_desc>
          <delta_ts>2015-07-30 23:47:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - HTML Editing APIs</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Aryeh Gregor">ayg</reporter>
          <assigned_to name="Aryeh Gregor">ayg</assigned_to>
          <cc>mike</cc>
    
    <cc>ojan</cc>
    
    <cc>public-webapps</cc>
    
    <cc>shezbaig.wk</cc>
          <deadline>2015-07-30</deadline>
          <qa_contact name="HTML Editing APIs spec bugbot">sideshowbarker+html-editing-api</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>62549</commentid>
    <comment_count>0</comment_count>
    <who name="Aryeh Gregor">ayg</who>
    <bug_when>2012-01-11 16:10:46 +0000</bug_when>
    <thetext>Suggested by Ojan Vafai: http://lists.w3.org/Archives/Public/public-webapps/2012JanMar/0090.html

I think we should expose it something like this:

* If the element does not have contenteditable set to true, throw.  (This means we should also throw for the body of a document with designMode, unless that body also has contenteditable=true.)
* For things like styleWithCSS, set the flag for that editing host and its descendants only.
* For regular commands like bold, run the command restricted to the descendants of that editing host.

This solves the problem of clicking the B button next to one editing host and making text in another editing host bold, or styleWithCss etc. changes leaking between editing hosts.  If we do this, I&apos;d also be okay with adding new flags.

There are two important changes we&apos;d need here, I think:

1) Make a concept of &quot;editing flags&quot; or something (not a good name; they might contain data, not just booleans).  The document always has a value for each editing flag, and you can set them on an editing host too by calling execCommand() on it, but by default they&apos;re all set to &quot;inherit&quot; for non-document editing hosts.  To get the editing flag for an element, go up the DOM until you hit something with the flag set.  Then change things like &quot;If the CSS styling flag is false:&quot; to &quot;If the CSS styling flag for node is false:&quot;.

2) Change things like &quot;Let element list be all editable Elements effectively contained in the active range&quot; to exclude anything outside the node you called execCommand() on.

While I&apos;m at it, it might make sense to fix bug 13911.

This should be flagged prominently as a new unimplemented feature, so that implementers should be sure to critique the design if they don&apos;t completely like it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>