WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
45681
Assertion failure: m_isValid == validity()->valid() after manipulating a detached element
https://bugs.webkit.org/show_bug.cgi?id=45681
Summary
Assertion failure: m_isValid == validity()->valid() after manipulating a deta...
Alexey Proskuryakov
Reported
2010-09-13 10:10:16 PDT
Created
attachment 67422
[details]
test case (may crash) See attached test case.
Attachments
test case (may crash)
(182 bytes, text/html)
2010-09-13 10:10 PDT
,
Alexey Proskuryakov
no flags
Details
Patch
(3.92 KB, patch)
2010-09-13 17:37 PDT
,
Kent Tamura
no flags
Details
Formatted Diff
Diff
Patch 2 (resolve redundant setNeedsValidityCheck())
(5.05 KB, patch)
2010-09-15 18:24 PDT
,
Kent Tamura
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Kent Tamura
Comment 1
2010-09-13 17:37:13 PDT
Created
attachment 67493
[details]
Patch
Alexey Proskuryakov
Comment 2
2010-09-15 17:13:00 PDT
Comment on
attachment 67493
[details]
Patch Why do we need to call setNeedsValidityCheck() in both functions? One of these always calls another. If we do need that, it may be worth a comment in code, or at the very least, in ChangeLog.
Kent Tamura
Comment 3
2010-09-15 18:20:24 PDT
Thank you for the feedback. (In reply to
comment #2
)
> (From update of
attachment 67493
[details]
) > Why do we need to call setNeedsValidityCheck() in both functions? One of these always calls another. > > If we do need that, it may be worth a comment in code, or at the very least, in ChangeLog.
setNonDirtyValue() is called by other functions. We need to call setNeedsValidityCheck() in that case. I'll improve the code to reduce redundant calls of setNeedsValidityCheck().
Kent Tamura
Comment 4
2010-09-15 18:24:25 PDT
Created
attachment 67754
[details]
Patch 2 (resolve redundant setNeedsValidityCheck())
Alexey Proskuryakov
Comment 5
2010-09-16 10:52:19 PDT
> setNonDirtyValue() is called by other functions.
OK, but why wouldn't it be sufficient to only have setNeedsValidityCheck() in setNonDirtyValue()? Since setValue() calls it, it doesn't seem to also call the same function. Talking about the new patch - this is probably a related question, but why can't setNeedsValidityCheck() be in setValueCommon()? Does its behavior depend on m_isDirty value? It doesn't use it explicitly, and if an indirect use is the reason not to put this call in setValueCommon(), then a comment should explain that (and setNeedsValidityCheck() probably needs a better name, since it does something different than setting a "needsValidityCheck" boolean). Both these patches confuse me, but it seems that a larger refactoring may be needed. If so, the first one might actually be better as a targeted fix, as it's simpler and doesn't add a new method.
Kent Tamura
Comment 6
2010-09-20 20:38:54 PDT
(In reply to
comment #5
)
> > setNonDirtyValue() is called by other functions. > > OK, but why wouldn't it be sufficient to only have setNeedsValidityCheck() in setNonDirtyValue()? Since setValue() calls it, it doesn't seem to also call the same function. > > but why can't setNeedsValidityCheck() be in setValueCommon()? Does its behavior depend on m_isDirty value?
Right. setNeedsValidityCheck() result depends on m_isDirty value. The name "setNeedsValidityCheck" doesn't represent the current behavior. The role of setNeedsValdityCheck was to set "needs to recalculate element validity", and the name followed "setNeedsStyleRecalc". But we need to calculate validity in setNeedsValidityCheck for some reasons. I don't think we'll have a large refactor for needsValidityCheck, but we should rename it.
Alexey Proskuryakov
Comment 7
2010-09-22 10:46:31 PDT
Comment on
attachment 67754
[details]
Patch 2 (resolve redundant setNeedsValidityCheck()) OK. So, do you prefer the old or the new patch yourself? Given that you kept the new one for review, I guess that's it, so I'll mark it r+.
> ta.checkValidity(); // This made an assertion failure.
"This made an assertion fail".
Kent Tamura
Comment 8
2010-09-27 23:51:17 PDT
(In reply to
comment #7
)
> (From update of
attachment 67754
[details]
) > OK. So, do you prefer the old or the new patch yourself? Given that you kept the new one for review, I guess that's it, so I'll mark it r+.
Yeah, I prefer the second patch. Thanks for r+.
> > ta.checkValidity(); // This made an assertion failure. > > "This made an assertion fail".
I'll fix it before landing.
Kent Tamura
Comment 9
2010-09-28 00:10:54 PDT
Landed as
r68494
.
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