Merge lp:~sinzui/launchpad/progressive-enhancement-ftw into lp:launchpad
Status: | Merged |
---|---|
Approved by: | j.c.sackett |
Approved revision: | no longer in the source branch. |
Merged at revision: | 15180 |
Proposed branch: | lp:~sinzui/launchpad/progressive-enhancement-ftw |
Merge into: | lp:launchpad |
Diff against target: |
646 lines (+245/-134) 17 files modified
lib/lp/app/doc/lazr-js-widgets.txt (+13/-16) lib/lp/app/javascript/autocomplete/autocomplete.js (+0/-7) lib/lp/app/javascript/picker/tests/test_personpicker.html (+4/-4) lib/lp/app/javascript/picker/tests/test_picker_patcher.html (+4/-4) lib/lp/app/javascript/tests/test_multicheckboxwidget.html (+3/-4) lib/lp/app/templates/inline-multicheckbox-widget.pt (+10/-9) lib/lp/app/templates/inline-picker.pt (+15/-19) lib/lp/bugs/javascript/bugtask_index.js (+1/-1) lib/lp/bugs/javascript/official_bug_tags.js (+11/-8) lib/lp/bugs/javascript/tests/test_official_bug_tags.html (+133/-0) lib/lp/bugs/javascript/tests/test_official_bug_tags.js (+49/-0) lib/lp/bugs/templates/bugtarget-macros-filebug.pt (+1/-3) lib/lp/bugs/templates/official-bug-target-manage-tags.pt (+1/-3) lib/lp/bugs/tests/testfiles/sourceforge-project-fronobulator.html (+0/-45) lib/lp/bugs/tests/testfiles/sourceforge-tracker-5570.html (+0/-3) lib/lp/registry/stories/project/xx-project-edit.txt (+0/-3) lib/lp/registry/templates/product-index.pt (+0/-5) |
To merge this branch: | bzr merge lp:~sinzui/launchpad/progressive-enhancement-ftw |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
j.c.sackett (community) | Approve | ||
Richard Harding (community) | code* | Approve | |
Review via email: mp+103733@code.launchpad.net |
Commit message
Avoid noscript because it contradicts progressive enhancement assumptions.
Description of the change
Several features fail for less common browsers because noscript is used
for the default markup. When progressive enhancement fails, there is no
default markup to fallback to. YUI assumes progressive enhancement works.
Over the last 3 years, we have seen IE, Opera, Konquorer and Firefox 3
break because progressive enhancement failed without fallback.
This branch fixes half of the issues which prevent users from completing
tasks.
-------
RULES
Pre-
* Remove all uses of noscript that have a YUI counterpart.
* Remove noscript that setups up visibility state.
QA
These acceptance tests require firefox, chromium, ie8 and knoquorer.
Also, one browser should have js disabled to verify a plain html link
is always available:
Person Picker
* Visit https:/
* Verify there is an action change the maintainer and the driver.
The driver action also has a help link.
* Verify that the action shows the overlay or html page.
Person Picker and Picker Patcher
* Visit https:/
* Verify there the drafter and implementations status can be changed
Multicheckbox Widget
* Visit https:/
* Verify there the distribution series can be changed.
Official bug tags
* Visit https:/
* Verify the plain html form is shown to non-js browsers.
* Verify that the js form is shown to js-enabled-browsers
Project group choose product
* Visit https:/
* Choose Launchpad, enter a summary, then choose Next.
* In a js-enabled browser verify the URL says that you are at
launchpad
* In a non-js browser verify the URL is still at launchpad-project
and you can see Launchpad selected in the project field
Configuration Progress
* Visit https:/
* In a js-enabled browser, verify the Configuration Progress is shown,
/but/ the applications are collapsed.
* In a non-js browser, verify the Configuration Progress is shown,
/and/ the applications are shown too.
File Bug Extra Options
* Visit https:/
* Enter 'athena' in the summary summary and choose Next.
* In a js-enabled browser, verify extra options is collapsed.
* In a non-js browser, verify the extra options are visible.
LINT
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
lib/
TEST
./bin/test -vv -t lazr-js-widgets lp.app.
./bin/test -vv --layer=YUItest lp.app
./bin/test -vv --layer=YUItest lp.bugs
IMPLEMENTATION
The picker, the patcher and multicheckbox widget all used a button for
js browsers, and an anchor for non-js browsers. All three cases were
fixed by replacing the button with the anchor and adding "lazr-btn
yui3-activator-act" to the class. Note that the inline edit picker
doctest was wrong...it never tested that the widget rendered in edit
mode with all the proper css! Two of the widget templates needed a root
element so that I could lint them.
lib/
lib/
lib/
lib/
lib/
lib/
I removed the noscript around the plain official bug tags html form and
added a line to the script to hide the html form when setup completes.
Alas there was no YUI test for the script, and the script had lint. I
did the minimum to hush lint and test my line of code.
lib/
lib/
lib/
lib/
I removed the noscript from the product widget because it is only shown
on the project group page. It might have been needed in the past, but
users with js browsers cannot see it anyway because when you make your
selection, your browser changes the context to the real product, so Lp
was hiding the widget on a page that js users never load. See below for
the explanation of why 'unseen' is not needed.
lib/
The lp.app.expander module is our friend. It handles the setup and
fallback rules for blocks with the 'collapsible' class. Pages and
scripts do not need to set the initial state of visibility or add rules
to ensure non-js browsers can see the block. I removed the 'unseen'
class from +filebug extra options and the css redefines for collapsible
because the markup is visible by default. These rules are cruft that
could have been removed when we enabled lp.app.expander lp.app.expander.
lib/
Thanks for this. I really love to see this noscript stuff die in a fire. A few comments and info to look into. I'm going to mark as needs fixing mainly based on our irc conversation and the alt text note below.
- wgrant brought up that a div in span tag (line #24) isn't valid. This appears to 'run deep' though in the layout and I'm worried that the activator message box bits will break if it's not a div. Can you investigate? Can we just make it another span and css that up to be a display: block to make it quick/easy to update? This will require checking the css and the js for relying on the div bit in selectors and such for both classes yui3-activator- message- box and yui3-activator- hidden
- Should we be adding alt text to the <a links? Not sure if screen readers will do title if alt not there, etc. In doing a quick google, it seems many by default will not read title, but alt. Title is handy for hover in browsers though. I see comments that adding both with the same informationis bad though. The idea is that alt says what something *is* while title says where it'll go if clicked? So for the edit links, it might be an alt says 'edit button' while the title text would be 'edit object xxx'.
- Discussed in irc the implications of having the <a tags all invisible-link, in particular for non-js users and non-graphical users.
- #239 the link goes out to egg?
- #407 if the unseen css class isn't needed is the div needed at all?