You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2005/11/25 19:25:31 UTC
DO NOT REPLY [Bug 37639] New: -
[PATCH] Whitespace handling revised
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37639>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=37639
Summary: [PATCH] Whitespace handling revised
Product: Fop
Version: 0.90
Platform: All
OS/Version: All
Status: NEW
Severity: trivial
Priority: P2
Component: fo tree
AssignedTo: fop-dev@xmlgraphics.apache.org
ReportedBy: a_l.delmelle@pandora.be
In attach a diff concerning the relocation of Block.handleWhitespace() to a separate class (current
working title: XMLWhitespaceHandler).
Apart from relocating the method, I also revised the whole algorithm, hence why I make it a patch
proposal first.
Whitespace-handling is now triggered in FObjMixed:
- once when a non-text child node is added -- for all FOText and Character descendants up to here
- once at endOfNode(), in case there are no nested nodes or else to deal with the last batch of text
I made the XMLWhitespaceHandler itself an instance variable in the FOEventHandler. Not sure if this sits
right with you all, but it just seemed like the best of options... Guaranteed only one separate instance
per document, easy access etc.
Have a look and let me know if it needs improvement.
Cheers,
Andreas
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
Re: DO NOT REPLY [Bug 37639] New: - [PATCH] Whitespace handling revised
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Nov 25, 2005, at 19:25, bugzilla@apache.org wrote:
Hi all,
I have some other questions/remarks that don't directly concern this,
but I ran into them while looking at this so... Anyway, not really
pressing matters, just wondering.
Concerning FObjMixed class hierarchy, which looks like
FObjMixed
-> Block
-> Marker
-> RetrieveMarker
-> BidiOverride
-> Wrapper
-> InlineLevel
-> Leader
-> Title
-> Inline
-> BasicLink
What is RetrieveMarker doing here? FObjMixed is a class meant for FOs
that can also contain #PCDATA. Now, retrieve-marker should always be
empty, so can't have *any* child nodes...
(Note: Perhaps we should consider writing a custom superclass for FOs
that are empty by definition (?))
Why does BasicLink descend from Inline, and not InlineLevel?
Looking at this (and the posted patch), it may be interesting to note
that my current whitespace handling strategy treats all FObjMixed the
same way, with the notable exception of Block. All the others are
treated the same as inlines: no whitespace-collapsing with preceding
or following space, leading and trailing spaces are at most collapsed
to one space. (The exception being when the character preceding a
given node is a linefeed...)
Cheers,
Andreas
Re: DO NOT REPLY [Bug 37639] New: - [PATCH] Whitespace handling revised
Posted by Andreas L Delmelle <a_...@pandora.be>.
On Nov 25, 2005, at 19:40, Finn Bock wrote:
> [Andreas]
>
>> Have a look and let me know if it needs improvement.
>
> Your renaming of whiteSpaceTreatment and whiteSpaceCollapse is a
> break from the automatic naming of all the other property instance
> vrbl names. I capitalized each '-' seperated word in the property
> name: "white-space-treatment" and "white-space-collapse".
OK. I guess this happened once inadvertently, and I just continued
upon that.
Thanks for spotting, I'll modify.
Cheers,
Andreas
Re: DO NOT REPLY [Bug 37639] New: - [PATCH] Whitespace handling
revised
Posted by Finn Bock <bc...@worldonline.dk>.
[Andreas]
> Have a look and let me know if it needs improvement.
Your renaming of whiteSpaceTreatment and whiteSpaceCollapse is a break
from the automatic naming of all the other property instance vrbl names.
I capitalized each '-' seperated word in the property name:
"white-space-treatment" and "white-space-collapse".
regards,
finn