Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
book.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 May 2012 at 17:45 UTC
Updated:
8 Feb 2015 at 11:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nod_forgot tag
Comment #2
nod_wrong patch :/
Comment #3
droplet commentedAbove patch looks good. Considering for performance, I preferred use this class.
'#attributes' => array('class' => array('book-title-select')),Comment #4
nod_You're right. Less likely to break too.
Comment #5
droplet commentedComment #6
dries commentedWhy are we making this change?
Comment #7
nod_The patch scope the search of the form input to the current vertical tab. Previously it would search from the whole document.
The previous selector was not very optimized:
.some-class-name selectwill always be slower to match than.some-class-name.I haven't run into bugs because of all that but it improves performance. I wouldn't call it micro-optimization since this is the DOM we're talking about.
Comment #8
nod_benchmark backing it up: http://jsperf.com/drupal-book-selector At least 10x faster. In chrome it's actually 100x faster.
Changing to this types of selector will make using the native querySelector much easier. Added the native selector to the benchmark, it's between 2x (opera) and 390x (chrome!) faster.
Now this is just one file, we have tens of files with the same kind of things, it sure doesn't look like it but it's an important patch.
Comment #9
dries commentedThanks for the clarifications. Committed to 8.x. Moving to 7.x.
Comment #10
jibranpatch for drupal-7
Comment #11
droplet commentedIt may not safely backport to D7 directly since someone may change the class name. (minor version upgrade issue)
Comment #12
nod_We don't have the manpower to backport this kind of patches. If this gets in 7, then all the other selectors patches should get in 7 and they are going to be more invasive than this one. Can't be sure it won't break contrib and manual testing doesn't scale.
Comment #14
manuel garcia commented