Closed
Bug 268285
Opened 20 years ago
Closed 19 years ago
Support includenamespaceprefixes attribute on xforms <submission> element.
Categories
(Core Graveyard :: XForms, enhancement)
Core Graveyard
XForms
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: darin.moz, Assigned: jhpedemonte)
References
Details
Attachments
(1 file, 1 obsolete file)
|
6.58 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
Support includenamespaceprefixes attribute on xforms <submission> element.
| Reporter | ||
Updated•20 years ago
|
Severity: normal → enhancement
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.8beta
Comment 2•20 years ago
|
||
The way to do this would probably be: during the serialization process, where we walk the instance document and clone nodes, we should create a hash table (assuming the attribute is set) and add all used namespaces to it. Probably a good intro bug.
Target Milestone: mozilla1.8beta1 → ---
Shouldn't be too tough. See me or Doron if you have any questions about the namespace serialization stuff.
Assignee: doronr → jhpedemonte
please also determine what our behavior should be if we have namespace prefixes in the instance document that are NOT mentioned as a value in the includenamespaceprefixes attribute.
Also, what does "in addition to those visibly utilized" mean? As mentioned under includenamespaceprefixes at: http://www.w3.org/TR/xforms/index-all.html#structure-model-submission
| Assignee | ||
Comment 6•19 years ago
|
||
The term "visibly utilized" is defined here: http://www.w3.org/TR/2002/REC-xml-exc-c14n-20020718/#sec-Terminology. From discussions with Doron, it seems that the |nsIDOMSerializer| automatically adds the namespace declaration if it finds the namespace prefix used, taking care of that requirement in the spec. In this patch, I just created a hash set as suggested by Doron to hold the namespace prefixes, then check for them in |AddNameSpaces()|.
| Assignee | ||
Updated•19 years ago
|
Attachment #187543 -
Flags: review?(doronr)
Updated•19 years ago
|
Attachment #187543 -
Flags: review?(doronr) → review+
| Assignee | ||
Updated•19 years ago
|
Attachment #187543 -
Flags: review?(smaug)
Comment 7•19 years ago
|
||
Comment on attachment 187543 [details] [diff] [review] patch > >+nsStringHashSet* >+nsXFormsSubmissionElement::GetIncludeNSPrefixesAttr() >+{ >+ nsStringHashSet* prefixHash = new nsStringHashSet(); Handle OOM. >+ prefixHash->Init(5); >+ >+ nsAutoString prefixes; >+ mElement->GetAttribute(kIncludeNamespacePrefixes, prefixes); >+ >+ // Cycle through space-delimited list and populate hash set >+ if (!prefixes.IsEmpty()) { >+ PRInt32 start = 0, end; >+ >+ do { >+ end = prefixes.FindChar(' ', start); Shouldn't we support also other whitespace characters?
Attachment #187543 -
Flags: review?(smaug) → review-
| Assignee | ||
Comment 8•19 years ago
|
||
This patch adds some error handling, and properly handles multiple consecutive spaces. + Shouldn't we support also other whitespace characters? Doesn't look like we need to. I added tabs, newlines, and carriage returns to my test case, but each time |GetAttribute()| returned a string that only contained spaces for the whitespace.
Attachment #187543 -
Attachment is obsolete: true
Attachment #187711 -
Flags: review?(smaug)
Comment 9•19 years ago
|
||
(In reply to comment #8) > Doesn't look like we need to. I added tabs, newlines, and carriage returns to > my test case, but each time |GetAttribute()| returned a string that only > contained spaces for the whitespace. Are you really sure about this. What happens if a script does something like submissionElement.setAttribute('includenamespaceprefixes', 'foo \t\t\t\n bar');
Comment 10•19 years ago
|
||
Comment on attachment 187711 [details] [diff] [review] patch v1.1 Though, adding tabs and newlines using scripts doesn't sound too likely and I'm not sure if we really have to handle that case. r=me
Attachment #187711 -
Flags: review?(smaug) → review+
| Assignee | ||
Comment 11•19 years ago
|
||
> Are you really sure about this. What happens if a script does something like
> submissionElement.setAttribute('includenamespaceprefixes', 'foo \t\t\t\n bar');
Yes, you are correct. With a script like that, I see those other whitespace
chars in the string returned from |GetAttribute()|. So, just to be safe, I'll
change that line to |FindCharInSet(" \t\r\n", start)| when checking in.
| Assignee | ||
Comment 12•19 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•