Closed Bug 300399 Opened 19 years ago Closed 19 years ago

MDGEngine calls ValidateNode before all external schemas have loaded

Categories

(Core Graveyard :: XForms, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: doronr, Assigned: aaronr)

References

()

Details

Attachments

(1 file)

nsXFormsModelElement::HandleEvent gets called for DOMContentLoaded, which makes
it set mDocumentLoaded to true.

nsXFormsModelElement::Revalidate() sees mDocumentLoaded is true and called
revalidate on the MDG.

Per spec, we need to wait for all schemas to load before we start binding I believe.
Testcase: http://www.nexgenmedia.net/bugs/300399/test.xhtml

When you load the page, both fields will be marked invalid (red).  This is
because ValidateNode calls Schema Validation, and it finds no loaded schemas and
returns an NS_ERROR_*.

Go into the first field and remove on of the digits (or add one), and it will
change to valid (after you tab out).  The type it binds to is an integer with a
maxInclude of 10000000.
Attached patch proposed fixSplinter Review
just moved the rebuild, recalculate and revalidate event generation to
nsXFormsModelElement::FinishConstruction, where steps 2, 3, and 4 from 4.2.1
live.	FinishConstruction should only be called when all of the schemas and
instance are done loading. This fix doesn't seem to cause any problems with my
testing so far.  Doron please try out with your external schema testcases.
Comment on attachment 189100 [details] [diff] [review]
proposed fix

fixes the issue for me!
Attachment #189100 - Flags: review+
Comment on attachment 189100 [details] [diff] [review]
proposed fix

Is this change going to hurt the MDG, Allan?  Doesn't seem to.
Attachment #189100 - Flags: review?(allan)
Comment on attachment 189100 [details] [diff] [review]
proposed fix

r=me
Attachment #189100 - Flags: review?(allan) → review+
checked in.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: