Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Issue 704733002: Adding Element.closest() API (Closed)

Created:
6 years, 1 month ago by Paritosh Kumar
Modified:
6 years, 1 month ago
Reviewers:
Habib Virji, pdr., lgombos, rune
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Adding Element.closest() API Implementing Element.closest() API according to specs https://dom.spec.whatwg.org/#dom-element-closest This API will parse selectors and if fails then throw SyntaxError else return closest ancestor that matches selectors if there is no ancestor that matches selectors, it will return nullptr. Blink-Dev Intent to Implement and ship Link : https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/yk_Fo6hyvb8 WebKit Change: http://trac.webkit.org/changeset/174324 BUG=422731 R=habib.virji@samsung.com Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=184946

Patch Set 1 #

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+223 lines, -0 lines) Patch
A LayoutTests/fast/selectors/element-closest.html View 1 1 chunk +124 lines, -0 lines 0 comments Download
A LayoutTests/fast/selectors/element-closest-expected.txt View 1 1 chunk +70 lines, -0 lines 0 comments Download
M Source/core/dom/Element.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/Element.cpp View 1 1 chunk +8 lines, -0 lines 0 comments Download
M Source/core/dom/Element.idl View 1 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/dom/SelectorQuery.h View 1 2 chunks +2 lines, -0 lines 0 comments Download
M Source/core/dom/SelectorQuery.cpp View 1 2 chunks +17 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
Paritosh Kumar
Please have a look. Thanks and Regards Paritosh
6 years, 1 month ago (2014-11-05 11:03:36 UTC) #1
Paritosh Kumar
On 2014/11/05 11:03:36, Paritosh Kumar wrote: > Please have a look. > > Thanks and ...
6 years, 1 month ago (2014-11-06 09:02:42 UTC) #2
pdr.
I think this looks great. LGTM. +cc Rune, just FYI.
6 years, 1 month ago (2014-11-07 01:41:00 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/704733002/1
6 years, 1 month ago (2014-11-07 01:41:14 UTC) #6
commit-bot: I haz the power
Committed patchset #1 (id:1) as 184946
6 years, 1 month ago (2014-11-07 02:57:41 UTC) #7
pdr.
Not LGTM. I'm going to roll this patch out. A colleague at Apple brought to ...
6 years, 1 month ago (2014-11-07 22:26:39 UTC) #9
pdr.
A revert of this CL (patchset #1 id:1) has been created in https://codereview.chromium.org/693203004/ by pdr@chromium.org. ...
6 years, 1 month ago (2014-11-07 22:28:32 UTC) #10
Paritosh Kumar
Ohh!!!! Sorry... I'm really sorry. Big Mistake.. I uploaded the patch from my test branch ...
6 years, 1 month ago (2014-11-10 09:06:12 UTC) #11
pdr.
6 years, 1 month ago (2014-11-11 00:23:41 UTC) #12
On 2014/11/10 at 09:06:12, paritosh.in wrote:
> Ohh!!!! Sorry... I'm really sorry. Big Mistake..
> 
> I uploaded the patch from my test branch not correct branch.
> 
> Surely, It won't work because, in this change I'm calling
> selectorQuery->matches with argument currntElement, that changes each time.
> and selectorQuery->matches calls SelectorDatalist::matches and it calls
> SelectorDatalist::selectorMatches with same argument for ContainerNode and
Element at
>
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...
> 
> and this results in change in scope every time at
>
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...
> 
> Actually initially I was trying with the above method and those two missing
conditions were failing
> so I done in different way in other branch but by mistake uploaded from the
incorrect branch. 
> And by mistake got committed also.
> 
> I'm very sorry for this major and serious mistake and will always take care in
future.
> 
> Please have a look on the actual change.
> 
> Again Many Apologize for the caused inconvenience and thanks for reverting
this ptach and thanks to that Apple colleague also.
> 
> Please have a look again.
> 
> Thanks & Regards
> Paritosh

This was pretty bad but mistakes happen; please do be extra careful going
forward. Lets start a new review for re-landing this. Please reupload (just run
"git cl issue 0" and then "git cl upload").

Is there any reason to split up the tests from the webkit patch? Lets keep them
separate so this is easier to review.

I did not catch this in the original review but please include the original
author's name and email in the change description. I would add "This patch is a
merge from webkit http://trac.webkit.org/changeset/174324 by Dhi Aurrahman
<​diorahman@rockybars.com>".

Powered by Google App Engine
This is Rietveld 408576698