Bug 218070 - whitespace preservation during region formatting
Summary: whitespace preservation during region formatting
Status: CLOSED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-02-06 15:18 EST by Nick Sandonato CLA
Modified: 2008-04-24 00:45 EDT (History)
1 user (show)

See Also:
for.work.things: review+


Attachments
Patch to scan ancestors for formatting constraints (10.58 KB, patch)
2008-02-06 16:47 EST, Nick Sandonato CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Sandonato CLA 2008-02-06 15:18:02 EST
Build ID: I20071213-1700

Steps To Reproduce:
1. Create an XML document that defines a node with the attribute xml:space="preserve"
2. Create a grandchild of that node
3. Select and format the grandchild node, whitespace will not be preserved.


More information:
During selected region formatting, only the parent of that region is inspected for whitespace formatting constraints; however, the XML spec states that the xml:space intent applies to all descendants unless overridden by another instance of xml:space.
Comment 1 Nick Sandonato CLA 2008-02-06 16:47:07 EST
Created attachment 89071 [details]
Patch to scan ancestors for formatting constraints

This patch also includes code that addresses NPE issues in Bug 218030.

This patch addresses the issue of selected region formatting failing to observe whitespace constraints that have been defined by ancestors older than a parent.  Now, the ancestry tree is examined for explicit declarations of whitespace strategy (xml:space=(preserve|default)).  If one is found, that strategy is applied to the constraints of the selected region for formatting.  If one is not found, the parent or default's strategy is used.
Comment 2 Amy Wu CLA 2008-02-06 21:52:53 EST
fix looks good. released for this week's 3.0 m5 build
Comment 3 Nitin Dahyabhai CLA 2008-02-07 02:34:51 EST
Reopening.
Comment 4 Nitin Dahyabhai CLA 2008-02-07 02:35:40 EST
Marking as fixed by Nick instead of inbox.
Comment 5 Nick Sandonato CLA 2008-02-11 17:05:47 EST
verified in wtp 3.0 m5 20080211073521
Comment 6 David Williams CLA 2008-04-24 00:45:02 EDT
mass change to add 'contributed' keyword based on bugzilla query, please correct if that's not accurate (by marking patches as obsolete and removing the 'contributed' keyword.