Last Comment Bug 278761 - Support indent attribute on xforms <submission> element.
: Support indent attribute on xforms <submission> element.
Status: RESOLVED WONTFIX
:
Product: Core Graveyard
Classification: Graveyard
Component: XForms (show other bugs)
: Trunk
: All All
: -- enhancement with 2 votes (vote)
: ---
Assigned To: Doron Rosenberg (IBM)
: Stephen Pride
Mentors:
Depends on:
Blocks: 263086 326372 326373
  Show dependency treegraph
 
Reported: 2005-01-17 14:21 PST by Darin Fisher
Modified: 2016-07-15 14:46 PDT (History)
4 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch (3.82 KB, patch)
2006-01-06 15:08 PST, Doron Rosenberg (IBM)
aaronr: review-
Details | Diff | Splinter Review
testcase (1.04 KB, application/xhtml+xml)
2006-01-06 15:09 PST, Doron Rosenberg (IBM)
no flags Details

Description Darin Fisher 2005-01-17 14:21:34 PST
Support indent attribute on xforms <submission> element.
Comment 1 Doron Rosenberg (IBM) 2005-02-21 12:49:02 PST
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?
Comment 2 Doron Rosenberg (IBM) 2006-01-06 15:08:14 PST
Created attachment 207767 [details] [diff] [review]
patch
Comment 3 Doron Rosenberg (IBM) 2006-01-06 15:09:15 PST
Created attachment 207768 [details]
testcase
Comment 4 aaronr 2006-02-14 16:46:11 PST
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()?
Comment 5 David Bolter [:davidb] 2016-02-04 12:21:09 PST
RIP xforms

Note You need to log in before you can comment on or make changes to this bug.