This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25526 - Invalid IDL fragment in 4.10.20 - APIs for text field selections
Summary: Invalid IDL fragment in 4.10.20 - APIs for text field selections
Status: RESOLVED WORKSFORME
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords: CR
Depends on:
Blocks:
 
Reported: 2014-05-01 04:29 UTC by Glenn Adams
Modified: 2014-05-01 04:38 UTC (History)
3 users (show)

See Also:


Attachments

Description Glenn Adams 2014-05-01 04:29:48 UTC
The first fragment of IDL defined in 4.10.20 is invalid as a standalone IDL fragment. In particular, it cannot be extracted and inserted into an IDL file without producing a syntax error. All other IDL fragments in the spec do not have this problem. This presents a problem for tools that harvest IDL from the HTML spec in order to construct a valid IDL file corresponding to the IDL entities defined in the spec. Further, at present, the current definition is semantically incomplete from the IDL perspective since it fails to bind the two affected interfaces with the members defined by this fragment.

In order to correct, I would suggest wrapping these methods in a new [NoInterfaceObject] interface definition which is then used in "implements" statements for the HTML{Input,TextArea}Element interfaces. 

For example, add the wrapper:

interface TextSelection {
  ...
};
HTMLInputElement implements TextSelection;
HTMLTextAreaElement implements TextSelection;

where ... is the current incomplete fragment:

  void select();
           attribute unsigned long selectionStart;
           attribute unsigned long selectionEnd;
           attribute DOMString selectionDirection;
  void setRangeText(DOMString replacement);
  void setRangeText(DOMString replacement, unsigned long start, unsigned long end, optional SelectionMode selectionMode = "preserve");
  void setSelectionRange(unsigned long start, unsigned long end, optional DOMString direction = "preserve");

Note that this problem also holds with HTML5.1 nightly.
Comment 1 Glenn Adams 2014-05-01 04:38:56 UTC
On second look, I see these APIs are extracted from (and already defined on) HTML{Input,TextArea}Element. And thus, the IDL is effectively redundant. Perhaps a note could be added indicating this fact, so others won't trip over the same problem.

I also notice the second class in the HTML source "extract", which name is a bit odd in this context, but will suffice to filter out this fragment with an IDL harvesting tool.

Given this, I'm going to mark this as WORKSFORME.