WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
76428
Each style rule should have its own ID
https://bugs.webkit.org/show_bug.cgi?id=76428
Summary
Each style rule should have its own ID
Kent Tamura
Reported
2012-01-16 22:05:33 PST
I sometimes want to introduce one style rule to another WebKit developer. Now we have to introduce like: "The third item of the Indentation section in
http://www.webkit.org/coding/coding-style.html
" If we introduced id attributes like <li id="indentation-namespace" title="#indentation-namespace">The contents of an outermost <code>namespace</code> block (and any nested namespaces with the same scope) , we would be able to introduce it by a URI reference like
http://www.webkit.org/coding/coding-style.html#indentation-namespace
Attachments
Patch
(22.39 KB, patch)
2012-01-19 23:11 PST
,
Kent Tamura
no flags
Details
Formatted Diff
Diff
Patch 2
(22.56 KB, patch)
2012-01-19 23:42 PST
,
Kent Tamura
no flags
Details
Formatted Diff
Diff
Patch for landing
(22.84 KB, patch)
2012-01-20 00:39 PST
,
Kent Tamura
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Kent Tamura
Comment 1
2012-01-19 23:11:31 PST
Created
attachment 123256
[details]
Patch
David Levin
Comment 2
2012-01-19 23:17:36 PST
How do I get a link to a rule? I kind of want some sort of href so I can click it and it will update the address bar with the correct link for that rule. Does that make sense?
Kent Tamura
Comment 3
2012-01-19 23:42:14 PST
Created
attachment 123258
[details]
Patch 2 Make LI clickable
Kent Tamura
Comment 4
2012-01-19 23:44:30 PST
(In reply to
comment #2
)
> How do I get a link to a rule? > > I kind of want some sort of href so I can click it and it will update the address bar with the correct link for that rule. Does that make sense?
I examined such idea, but I thought enclosing each of <li> with <a href=></a> looked bad. WIth the latest patch, a LI element has title="#id" and is clickable to jump to #id.
David Levin
Comment 5
2012-01-20 00:11:39 PST
Comment on
attachment 123258
[details]
Patch 2 View in context:
https://bugs.webkit.org/attachment.cgi?id=123258&action=review
> Websites/webkit.org/coding/coding-style.html:233 > +<li id="linebreaking-multiple-satements">Each statement should get its own line.
s/satements/statements/
> Websites/webkit.org/coding/coding-style.html:249 > +<li id="linebreaking-elese-braces">An <code>else</code> statement should go on the same line as a preceding close brace if one is present,
s/elese/else/
> Websites/webkit.org/coding/coding-style.html:1104 > + listItems[i].setAttribute('title', '#' + listItems[i].id);
May I get a hand as well so I can quick tell what is clickable? (I don't think that is there just b/c you are listening for the click event.) listItems[i].style.cursor = ' pointer';
> Websites/webkit.org/coding/coding-style.html:1107 > + });
Perhaps it should check for duplicate ids as well? Something like this: var idsUsed = new Object(); for ... if (idsUsed[listItems[i].id]) alert("The id " + listItems[i].id + " is used more than once in this document."); idsUsed[listItems[i].id] = 1;
Kent Tamura
Comment 6
2012-01-20 00:39:14 PST
Created
attachment 123266
[details]
Patch for landing
Kent Tamura
Comment 7
2012-01-20 00:40:18 PST
Comment on
attachment 123258
[details]
Patch 2 View in context:
https://bugs.webkit.org/attachment.cgi?id=123258&action=review
Thanks. I followed your comments.
>> Websites/webkit.org/coding/coding-style.html:1104 >> + listItems[i].setAttribute('title', '#' + listItems[i].id); > > May I get a hand as well so I can quick tell what is clickable? (I don't think that is there just b/c you are listening for the click event.) > > listItems[i].style.cursor = ' pointer';
Adding :hover style might be helpful too.
Kent Tamura
Comment 8
2012-01-20 01:23:23 PST
Committed
r105494
: <
http://trac.webkit.org/changeset/105494
>
mitz
Comment 9
2012-02-10 11:58:28 PST
This change made it extremely hard to use double- or triple-clicking to select anything on the Coding Style Guidelines webpage, and to click to clear the selection. In OS X, it also made WebKit almost always show a tool tip over the page, obscuring the content. I don’t see how any of the changes here that detracted from the page’s usability have to do with the statement “each style rule should have its own ID”.
Kent Tamura
Comment 10
2012-02-13 00:27:37 PST
(In reply to
comment #9
)
> This change made it extremely hard to use double- or triple-clicking to select anything on the Coding Style Guidelines webpage, and to click to clear the selection. In OS X, it also made WebKit almost always show a tool tip over the page, obscuring the content. I don’t see how any of the changes here that detracted from the page’s usability have to do with the statement “each style rule should have its own ID”.
Thank you for the comment. Let's improve it in
Bug 78470
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug