[Webkit-unassigned] [Bug 84242] New: Web Inspector: Radio buttons in Audits tabs don't work

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Apr 18 08:01:19 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=84242

           Summary: Web Inspector: Radio buttons in Audits tabs don't work
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Inspector
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: apavlov at chromium.org
                CC: eric at webkit.org, hyatt at apple.com, timothy at apple.com,
                    mitz at webkit.org, rik at webkit.org,
                    simon.fraser at apple.com, keishi at webkit.org,
                    pmuellr at yahoo.com, joepeck at webkit.org,
                    pfeldman at chromium.org, yurys at chromium.org,
                    bweinstein at apple.com, apavlov at chromium.org,
                    jamesr at chromium.org, loislo at chromium.org


What steps will reproduce the problem?
1. Open any webpage in Chrome. (eg www.google.com).
2. Right click anywhere on it and select Inspect element.
3. Now click the Audits tab. Select the radio button "Reload Page and Audit on load"
[if the radiobuttons work for you, follow the next steps WITHOUT switching to another window (i.e. the entire step sequence must be run with the browser window always focused)]
4. Switch to the Profiles panel and back to the Audits window
5. Select the "Audits" tree element in the lefthand tree to open the audits launcher view. Now the radio buttons look dead.

What is the expected result?
The radio button should toggle the option we click another one.

What happens instead?
The radio button don't toggle.

(Upstreaming http://code.google.com/p/chromium/issues/detail?id=123289)

Now some investigation results:
1. The radio buttons do toggle but are never repainted. This can be checked by clicking "Audit Present State" and "Run" - the audits will run without reloading the page.
2. When steps 4 and 5 are run (I only very rarely can reproduce the issue in Chromium without them), certain container DIVs corresponding to removed views are detached from the DOM tree to speed up rendering, and those corresponding to shown panels are inserted (element.appendChild) - this is the common way to switch views in Web Inspector.
3. When a radio button is clicked, HTMLInputElement::setChecked() invokes setNeedsStyleRecalc(), which calls markAncestorsWithChildNeedsStyleRecalc(). Its loop stops quickly (like, at the parent <label> element, for which childNeedsStyleRecalc() == true), and I believe the algorithm presumes that this condition holds for all its ancestors. However, this seems wrong: if I comment out the "&& !p->childNeedsStyleRecalc()" part of the condition, the radio buttons start working as expected. Stepping through the loop (with this fix in place), I found out that p->childNeedsStyleRecalc() == false for the container DIV that was detached (element.removeChild) and then re-inserted (element.appendChild) into the Web Inspector DOM, as well as its ancestors chain.
4. I thought that it would be sufficient to add
  setChildNeedsStyleRecalc();
  markAncestorsWithChildNeedsStyleRecalc();
at the end of Node::attach() but it proved wrong - I observed the absence of attached view contents altogether.
5. I noticed that lazyAttach() runs markAncestorsWithChildNeedsStyleRecalc() but could not deduce what lazyAttach() is for, and when it comes into play instead of attach() (I saw some work by jamesr@ to retain lazyAttach() as the only option.)

Does anyone have any insight of what's happening/how this works and what can be done to fix this? (Obviously, not the "Web Inspector" component...)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list