Re: Re: Indexing HTML Attributes and Unique Indexes

2019-05-24 Thread Isiah Meadows
You'd have better luck asking for this feature in https://discourse.wicg.io. ES Discuss is about the JS language itself and the related ECMAScript spec, not the Web APIs that are implemented in most browsers, usually separately to the JS implementations themselves. - Isiah Meadows

Re: Re: Indexing HTML Attributes and Unique Indexes

2019-05-23 Thread guest271314
> I want to avoid dealing with HTML Using HTML is part of premise of the proposal, correct? Am still not sure what the actual requirement is. If the requirement is to prevent duplicate _values_ being input by the user you can utilize ```pattern``` attribute of `` with a ```RegExp``` which

Re: Re: Indexing HTML Attributes and Unique Indexes

2019-05-23 Thread Randy Buchholz
Sorry. My confusion. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Re: Indexing HTML Attributes and Unique Indexes

2019-05-23 Thread Andrea Giammarchi
> while it could be considered a sub-set, JS is full of HTML related features - `HTMLElement` for one. HTMLElement is defined by the living DOM standard (WHATWG) https://html.spec.whatwg.org/multipage/dom.html#htmlelement it has nothing to do with JS. JS is a general purpose programming

Re: Re: Indexing HTML Attributes and Unique Indexes

2019-05-23 Thread Randy Buchholz
@Andrea Giammarchi, While the connection is secondary, HTML often serves as the specification for the creation of JS objects. And while it could be considered a sub-set, JS is full of HTML related features - `HTMLElement` for one. Thing is, if you are

Re: Re: Indexing HTML Attributes and Unique Indexes

2019-05-23 Thread Andrea Giammarchi
it's meant there couldn't be two indexes with the same value, but even IDs can be duplicated on a page (it's not suggested or anything, but nothing prevents you to do that) to be honest, since IDs already cover the whole story (IDs are accessible even via globalThis/window, no need to query the

Re: Re: Indexing HTML Attributes and Unique Indexes

2019-05-23 Thread guest271314
If the HTML elements have a unique ```id``` set there is not search to perform (```document.getElementById("id")```), correct? Form fields can be created, set and changed using `FormData` objects without using HTML elements at all. Still not gathering what is meant by unique indexes. On Thu,

Re: Re: Indexing HTML Attributes and Unique Indexes

2019-05-23 Thread Randy Buchholz
Full Table Scans and Unique indexes are database concepts (that's the DBA reference). When a database searches for a record based on a column value, it might look at every record in the table to find the matches - scan the entire (full) table, in the order the records were inserted or stored.

Re: Indexing HTML Attributes and Unique Indexes

2019-05-22 Thread guest271314
some of the “columns”. I’m > sure the engines are pretty optimized for this though. > > > > *From:* Andrea Giammarchi > *Sent:* Wednesday, May 22, 2019 12:25 PM > *To:* Randy Buchholz > *Cc:* es-discuss@mozilla.org > *Subject:* Re: Indexing HTML Attributes and Unique Indexe

Re: Indexing HTML Attributes and Unique Indexes

2019-05-22 Thread Oriol _
> About being unique, you can always > `document.querySelector('[attribute="' + value +'"]')` This code is vulnerable to CSS injection, input values shouldn't be inserted raw into queries! You can use `CSS.escape` to sanitize. -- Oriol ___

Indexing HTML Attributes and Unique Indexes (Randy Buchholz)

2019-05-22 Thread Bob Myers
To: "es-discuss@mozilla.org" > Cc: > Bcc: > Date: Wed, 22 May 2019 17:07:01 + > Subject: Indexing HTML Attributes and Unique Indexes > > I’ve been working with `Custom Elements` and I’m writing a lot of code > against tag attributes. In some cases, I want the attr

RE: Indexing HTML Attributes and Unique Indexes

2019-05-22 Thread Randy Buchholz
”. I’m sure the engines are pretty optimized for this though. From: Andrea Giammarchi Sent: Wednesday, May 22, 2019 12:25 PM To: Randy Buchholz Cc: es-discuss@mozilla.org Subject: Re: Indexing HTML Attributes and Unique Indexes With Custom Elements you have `attributeChangedCallback` which reacts

Re: Indexing HTML Attributes and Unique Indexes

2019-05-22 Thread Andrea Giammarchi
live * On Wed, May 22, 2019 at 7:25 PM Andrea Giammarchi < andrea.giammar...@gmail.com> wrote: > With Custom Elements you have `attributeChangedCallback` which reacts > after `observedAttributes` returned attributes, and I believe you'd like to > use that to create getters and setters out of the

Re: Indexing HTML Attributes and Unique Indexes

2019-05-22 Thread Andrea Giammarchi
With Custom Elements you have `attributeChangedCallback` which reacts after `observedAttributes` returned attributes, and I believe you'd like to use that to create getters and setters out of the box. I don't think DOM specific class fields/syntax will ever land in JS itself, but I can suggest

Indexing HTML Attributes and Unique Indexes

2019-05-22 Thread Randy Buchholz
I've been working with `Custom Elements` and I'm writing a lot of code against tag attributes. In some cases, I want the attribute values to be unique on a page (like `id`). It got me wondering about how the engines handle attribute based searches, and if indexing (with unique/distinct