Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336813

Summary: XslFoDocumentBuilder should apply table attributes
Product: z_Archived Reporter: Torkild Resheim <torkildr>
Component: MylynAssignee: Torkild Resheim <torkildr>
Status: RESOLVED FIXED QA Contact: David Green <greensopinion>
Severity: enhancement    
Priority: P3 CC: per-arnold.blaasmo
Version: unspecified   
Target Milestone: 1.8.0   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 336905    
Attachments:
Description Flags
Patch to support table row and cell attributes in XslFoDocumentBuilder
none
mylyn/context/zip
none
mylyn/context/zip none

Description Torkild Resheim CLA 2011-02-10 08:17:57 EST
The XslFoDocumentBuilder is currently *not* applying table properties to any table elements which I think it should. If table attributes are available they should be applied to:
* Tables
* Table cells
* Table headers
* Table rows
Comment 1 Torkild Resheim CLA 2011-02-11 06:31:54 EST
Created attachment 188763 [details]
Patch to support table row and cell attributes in XslFoDocumentBuilder

This patch will apply certain table cell and row attributes to the generated XSL:FO if these attributes has been specified.
Comment 2 Torkild Resheim CLA 2011-02-11 06:31:56 EST
Created attachment 188764 [details]
mylyn/context/zip
Comment 3 David Green CLA 2011-03-03 01:25:51 EST
From what I've seen XSL-FO doesn't support a "border" attribute on anything table-related.  I referred to http://www.w3.org/TR/2006/REC-xsl11-20061205/#common-border-padding-and-background-properties and may have missed something, so please point out what if anything I'm missing.  Output from the XslfoDocumentBuilder should adhere to the spec if possible, or justify why the output should use the "border" attribute.
Comment 4 Per Arnold Blaasmo CLA 2011-03-03 07:18:41 EST
(In reply to comment #3)
> From what I've seen XSL-FO doesn't support a "border" attribute on anything
> table-related.  I referred to
> http://www.w3.org/TR/2006/REC-xsl11-20061205/#common-border-padding-and-background-properties
> and may have missed something, so please point out what if anything I'm
> missing.  Output from the XslfoDocumentBuilder should adhere to the spec if
> possible, or justify why the output should use the "border" attribute.

If you look at http://www.w3schools.com/xslfo/obj_table.asp you will see a lot of border attributes that can be applied to a table.
Comment 5 Per Arnold Blaasmo CLA 2011-03-03 07:27:56 EST
Also http://www.learn-xsl-fo-tutorial.com/Tables.cfm gives examples of using border on different levels.
Comment 6 David Green CLA 2011-03-03 12:07:54 EST
Agreed, there are lots of border attributes -- but none called "border".  The attached patch emits a "border" attribute for table items (cells, rows, etc.) when from what I can see in the spec, there's no such attribute.
Comment 7 Torkild Resheim CLA 2011-03-03 14:49:17 EST
(In reply to comment #6)
> Agreed, there are lots of border attributes -- but none called "border".  The
> attached patch emits a "border" attribute for table items (cells, rows, etc.)
> when from what I can see in the spec, there's no such attribute.
I was using the XSL 1.0 specs and these mention that you can use "shorthands" as in CSS for specifying border properties. See http://www.w3.org/TR/2001/REC-xsl-20011015/slice5.html#shortexpan

This code does produce the expected result.
Comment 8 David Green CLA 2011-03-04 12:03:18 EST
Great, thanks for the spec reference!  That's just what I was looking for.
Comment 9 David Green CLA 2011-08-05 16:49:57 EDT
The preferred way to apply attributes such as border is to specify it via a CSS style.  This is intended to follow the evolution of the HTML spec (where border attributes are no longer standard on TR and TD elements).

Changes I'd like to see in this patch:
* instead of adding @border@ to both @TableCellAttributes@ and @TableRowAttributes@, use the existing @Attributes.getCssStyle()@ instead
* in @XslfoDocumentBuilder@ augment @attributesFromCssStyles(String)@ to become aware of CSS that affects border
* write some unit tests to verify that the border CSS is applied correctly
Comment 10 David Green CLA 2011-08-05 16:50:26 EDT
Created attachment 201025 [details]
mylyn/context/zip
Comment 11 Torkild Resheim CLA 2011-08-07 03:50:01 EDT
Thanks David. Will take another look.
Comment 12 Torkild Resheim CLA 2012-06-26 07:41:27 EDT
I finally got around to have another look at this one. A patch for review is at https://git.eclipse.org/r/#/c/6515/
Comment 13 Torkild Resheim CLA 2012-06-26 16:39:46 EDT
Fixed in Change-Id: Ibdae65969fe733663966c86660ed1643d2dfab0c

Thanks for the review David!