Closed Bug 278761 Opened 20 years ago Closed 8 years ago

Support indent attribute on xforms <submission> element.

Categories

(Core Graveyard :: XForms, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: darin.moz, Assigned: doronr)

References

Details

Attachments

(2 files)

Support indent attribute on xforms <submission> element.
We are awaiting a response from the WG regarding indent.

Questions are:
  - what is the default behavior?  Submit the way it was defined in the
document, all on one line, pretty printed?
  - what if indent is false: single line, way defiend in the document?
Assignee: aaronr → doronr
Attached patch patchSplinter Review
Attachment #207767 - Flags: review?(aaronr)
Attached file testcase
Blocks: 326372
Blocks: 326373
Comment on attachment 207767 [details] [diff] [review]
patch

>Index: extensions/xforms/nsXFormsSubmissionElement.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/extensions/xforms/nsXFormsSubmissionElement.cpp,v
>retrieving revision 1.49
>diff -u -r1.49 nsXFormsSubmissionElement.cpp
>--- extensions/xforms/nsXFormsSubmissionElement.cpp	3 Jan 2006 20:57:46 -0000	1.49
>+++ extensions/xforms/nsXFormsSubmissionElement.cpp	6 Jan 2006 23:07:30 -0000

>@@ -1226,7 +1229,47 @@
>       // honor cdata-section-elements (see xslt spec section 16.1)
>       if (cdataElements.IsEmpty())
>       {
>-        dest->AppendChild(destChild, getter_AddRefs(node));
>+        if (indent)
>+        {
>+          // Check if the textnode is only made up of whitespace characters
>+          nsAutoString nodeValue;
>+          destChild->GetNodeValue(nodeValue);
>+
>+          PRBool isWhitespaceOnly = PR_TRUE;
>+          nsAString::const_iterator start, end;
>+          nodeValue.BeginReading(start);
>+          nodeValue.EndReading(end);
>+
>+          PRUnichar temp;
>+          while (start != end && isWhitespaceOnly) {
>+            temp = *start++;
>+
>+            if ((temp != ' ') && (temp != '\t') && (temp != '\r') && (temp != '\n'))
>+              isWhitespaceOnly = PR_FALSE;
>+          }
>+

you can't make character comparisons like this with a PRUnichar, can you?  Maybe should use nsXFormsXPathXMLUtil::IsWhitespace()?
Attachment #207767 - Flags: review?(aaronr) → review-
RIP xforms
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: