Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29347936: Issue 4211 - Improve detection of uninitialized documents for means of element hiding (Closed)

Created:
July 18, 2016, 2 p.m. by Wladimir Palant
Modified:
July 18, 2016, 6:08 p.m.
Reviewers:
Thomas Greiner
Visibility:
Public.

Description

Issue 4211 - Improve detection of uninitialized documents for means of element hiding Repository: hg.adblockplus.org/adblockplus

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -3 lines) Patch
M lib/child/elemHide.js View 1 chunk +4 lines, -3 lines 2 comments Download

Messages

Total messages: 3
Wladimir Palant
July 18, 2016, 2 p.m. (2016-07-18 14:00:41 UTC) #1
Thomas Greiner
LGTM While I haven't found any documentation on the "uninitialized" state, I found it being ...
July 18, 2016, 3:58 p.m. (2016-07-18 15:58:14 UTC) #2
Wladimir Palant
July 18, 2016, 6:07 p.m. (2016-07-18 18:07:18 UTC) #3
https://codereview.adblockplus.org/29347936/diff/29347937/lib/child/elemHide.js
File lib/child/elemHide.js (right):

https://codereview.adblockplus.org/29347936/diff/29347937/lib/child/elemHide....
lib/child/elemHide.js:331: // it doesn't fire when changing from "uninitialized"
state.
On 2016/07/18 15:58:14, Thomas Greiner wrote:
> While the "unitialized" state is not mentioned in
> https://www.w3.org/TR/html5/dom.html#documentreadystate (the listed states are
> considered non-normative so no issue), it clearly states that "When the value
is
> set, the user agent must fire a simple event named readystatechange at the
> Document object." (see
> https://www.w3.org/TR/html5/dom.html#current-document-readiness) so seems to
be
> a browser issue.

Given that "uninitialized" means "too early to be seen by any content JavaScript
code" - it's not surprising that Gecko devs cut this corner and don't fire an
event for the state change here. You can only observe this state from an
extension, and even here it might be considered a bug. Arguably,
content-document-global-created notification shouldn't fire before the document
is initialized.

Powered by Google App Engine
This is Rietveld