Issue 82637 - [a11y] default attributes should not be derived from the initial character in a paragraph
Summary: [a11y] default attributes should not be derived from the initial character in...
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: ui (show other issues)
Version: OOo 2.3
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: eric.savary
QA Contact: issues@sw
URL:
Keywords: accessibility
: 81718 (view as issue list)
Depends on:
Blocks:
 
Reported: 2007-10-15 16:20 UTC by joaniediggs
Modified: 2013-08-07 14:42 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description joaniediggs 2007-10-15 16:20:53 UTC
According to the AT-SPI documentation, "default attributes" are:

<cite>
the text attributes which apply to all text in the object by virtue of the
default settings of the document, view, or user agent; e.g. those attributes
which are implied rather than explicitly applied to the text object. For
instance, an object whose entire text content has been explicitly marked as
'bold' will report the 'bold' attribute via getAttributeRun(), whereas an object
whose text weight is inspecified may report the default or implied text weight
in the default AttributeSet.
</cite>
(http://www.gnome.org/~billh/at-spi-idl/html/interfaceAccessibility_1_1Text.html) 

This seems to be inconsistent with what is exposed as a “default attribute†by
OOo.  For instance:

1. Create a new document in OOo Writer
2. Press Control+B to toggle bold on.
3. Type the word "Bold"
4. Press Control+B to toggle bold off
5. Type " text is cool." followed by a bunch of other text that is not bold.

In the above example, the only word that will appear in bold is the initial
word; the rest of the characters in the paragraph lack that attribute.  Yet,
weight:600 is exposed to ATs as a default attribute.

In a comment on issue 81718, OD explained:

<cite>
A Control-B in an empty paragraph causes that the character property "Bold" is
set at the complete paragraph as its so-called default attributes. The reason
for this is the following feature in OOo Writer: A character attribute, which is
applied to all characters of a paragraph, are set as the so-called default
attributes for this paragraph - it's automatic paragraph style will contain this
attribute.
</cite>

Given that in the above example the bold attribute is not applied to all
characters of the paragraph, I do not think that bold should be exposed as a
default attribute for that paragraph.

My personal preference would be for OOo to expose attributes as "default"
attributes only if they were not explicitly specified/applied by the user -- as
suggested in the AT-SPI docs.  If that is not possible, then I would request
that attributes are exposed as "default" if they indeed apply to all characters
in that paragraph.  I believe that the current implementation, in which the
default attributes are those which were applied when beginning the paragraph, is
problematic.

Thanks!
Comment 1 joaniediggs 2007-10-15 16:23:53 UTC
It was suggested this be assigned to es due to a11y.
Comment 2 Oliver-Rainer Wittmann 2007-10-16 08:10:17 UTC
I think here is a misunderstanding.

The default attributes (character and paragraph attributes), which the OOo
Writer provides for a certain paragraph, are the attributes, which are applied
to the automatic paragraph style of this paragraph. These default attributes are
not the attributes of the initial character. A certain attribute of these
default attributes doesn't have to be visible. E.g., the default character
background color is "white" and the paragraph consists of 10 characters. The
first 5 characters have a background color run attribute "green" and the last 5
character have a background color run attribute "red". Thus, the default
character background color "white" isn't visible, but it is still the default
attribute for this paragraph.

Regarding my explanation from issue 81718 and your interpretation:
A character attribute, which is applied to all *existing* characters of a
paragraph, is set as a default attribute for this paragraph. Such a default
attribute isn't reset, when new characters are inserted, which have revise the
value of this character attribute via the corresponding run attribute. This is
the case for the given example: The "Bold" character attribute is set at an
empty paragraph. It is applied to "all existing characters" of the paragraph,
which are currently 0 characters. Thus, the "Bold" character attribute is set as
the default attribute.
Comment 3 Oliver-Rainer Wittmann 2007-10-16 08:18:05 UTC
I think here is a misunderstanding.

The default attributes (character and paragraph attributes), which the OOo
Writer provides for a certain paragraph, are the attributes, which are applied
to the automatic paragraph style of this paragraph. These default attributes are
not the attributes of the initial character. A certain attribute of these
default attributes doesn't have to be visible. E.g., the default character
background color is "white" and the paragraph consists of 10 characters. The
first 5 characters have a background color run attribute "green" and the last 5
character have a background color run attribute "red". Thus, the default
character background color "white" isn't visible, but it is still the default
attribute for this paragraph.

Regarding my explanation from issue 81718 and your interpretation:
A character attribute, which is applied to all *existing* characters of a
paragraph, is set as a default attribute for this paragraph. Such a default
attribute isn't reset, when new characters are inserted, which have revise the
value of this character attribute via the corresponding run attribute. This is
the case for the given example: The "Bold" character attribute is set at an
empty paragraph. It is applied to "all existing characters" of the paragraph,
which are currently 0 characters. Thus, the "Bold" character attribute is set as
the default attribute.
Comment 4 Oliver-Rainer Wittmann 2007-10-16 08:53:59 UTC
adding MT, OBR and myself in the CC group
Comment 5 eric.savary 2007-10-16 11:34:17 UTC
Reassigned
Comment 6 eric.savary 2007-10-16 12:39:38 UTC
.
Comment 7 joaniediggs 2007-10-16 17:27:06 UTC
Actually I think I understand.  I'm just not doing a very good job of
communicating what I think and want.  Sorry about that!

I personally think that to be consistent with what is described in the AT-SPI
docs, if a user explicitly changes an attribute (e.g. by pressing Control B) the
changed attribute is not a default attribute. Thus when using the templates that
ship with OOo, I would expect weight:600 to be a default attribute of the
Heading 1 paragraph style.  I don't make Heading 1's bold.  They just come that
way.  I would expect weight:400 to be a default attribute of the Default
paragraph style.  Default text isn't bold.  If I don't want my Heading 1 to be
bold and change my Heading 1 text by toggling bold off, I would still expect
weight:600 to be the default attribute and weight:400 to be a character
attribute associated with each and every character I modified.  Similarly, if I
wanted all of the characters in a given paragraph that uses Default as its style
to be bold and toggled that on, I would expect the default attribute to continue
to include weight:400 and the characters to have the attribute weight:600.  In
my mind, if I change it it's no longer default.  But that's just me....

Regarding your explanation, I *believe* I understood that as well.  My
suggestion is this:  Assuming you all do not agree with my suggested definition
of "default attribute", :-) I would suggest that perhaps the value *should* be
revised when new characters are inserted.  The example in my report is one in
which bold is not normally on, but had to be explicitly turned on by the user,
and it only applies to a few characters in the paragraph.  In that instance, in
my mind, bold is not a default attribute for that paragraph.  OOo Writer,
however, reports that it is.  For that matter, if the first paragraph consists
of some bold text, all subsequent paragraphs I type seem to report weight:600 as
a default attribute even though they are completely devoid of bold text.  Taking
it a step further, if the first paragraph is plain text, the second paragraph is
bold text, and the third paragraph is plain text, the first paragraph will
report a default weight of 400, the second will report a default weight of 600,
and the third will also report a default weight of 600.  To me, at the very
least, the first and third paragraphs should report the same weight as the
default because formatting-wise they are the same.
Comment 8 nospam4obr 2007-10-16 18:55:16 UTC
My understanding of the problem is the following (please correct me if I am wrong):

a) The default attributes of a paragraph in writer are an extra style level on
top of the paragraph style, page style etc..

b) The default attributes of a paragraph in writer are not "default attributes"
in the sense of at-spi (as they are explicitly set).

As the UNO <-> ATK/AT-SPI bridge is currently the primary (and probably also the
only) user of the corresponding UNO API, we might be able to change the API to
better suit AT-SPIs need, but let me check with the other evolving bridges (Mac
OS X, IAccessible2) first.
Comment 9 Oliver-Rainer Wittmann 2007-10-17 12:04:15 UTC
Some more background about attributes for a paragraph in OOo Writer.
Each paragraph has its own attribute set consisting of paragraph attributes and
character attributes - it's the automatic paragraph style of the paragraph and
it is unnamed. This automatic paragraph style is initially been empty - no
attribute value is found in it. For each attribute, which isn't set in the
automatic paragraph style, the automatic paragraph style inherits its attribute
values from the paragraph style, which is applied at the paragraph. Such a
paragraph style is one of the paragraph style you can find in the Stylist and it
is named - e.g. "Default" or "Heading 1" or "Text Body".
This model provides you the following features:
(1) If you have a couple of paragraphs applying the "Default" paragraph style
and you want that one of these paragraphs has a red background, you can directly
set this attribute at the automatic paragraph style of this paragraph instead of
creating a new paragraph style "Default, but red background" derived from the
"Default" paragraph style and applying this new paragraph style to the
corresponding paragraph.
(2) If you change/set a certain character attribute for all existing characters
of the paragraph to a certain value, this attribute isn't applied as a run
attribute. It's changed/set at the automatic paragraph style of this paragraph.
Thus, you can control such character attribute values with the automatic
paragraph style.
Nothing will be changed at this model and behavior in OOo Writer.

Only repeating it to have it in place: A Control-B at an empty paragraph changes
the character attribute <weight> to "bold" for all existing characters in this
paragraph and thus, this attribute is set a the automatic paragraph style of
this paragraph.

Some background about automatic paragraph style, when new paragraphs are inserted:
When a new paragraph is inserted, this new paragraph in general copies the
automatic paragraph style from the paragraph at which the insertion is initiated.
Thus, if you have a paragraph with a character weight bold in its automatic
paragraph style and hit enter at the end of this paragraph, the new inserted
paragraph has also the character weight bold in its automatic paragraph style.
The same is hold for paragraph indent attributes, which are set in the automatic
paragraph style of a paragraph.
Nothing will be changed at this model and behavior in OOo Writer.

Now back to the UNO accessibility API and AT-SPI:
<XAccessibleTextAttributes::getDefaultAttributes()> provides the attribute set
of the automatic paragraph style of a paragraph.
From what joaniediggs is saying I assume, that the AT-SPI expects to get the
default values for the character attributes for a paragraph from the paragraph
style and not from the automatic paragraph style. The default values for the
paragraph attributes - e.g. left margin - still has to come from the automatic
paragraph style. Is this correct? If yes, this would have the consequence, that
an character attribute, which is set in the automatic paragraph style of a
paragraph, has to be reported as a run attribute at every character of this
paragraph, if this attribute isn't changed for any of the characters.
Comment 10 malte_timmermann 2007-10-24 11:48:50 UTC
For clarification:

A paragraph has 3 types of attribute containers:
1) StyleSheets (property map)
2) ParaAttribs (property map)
3) CharAttribs (List of properties with start/end pos)

There are 2 kind of attributes involved: Some of them can only be applied to
paragraphs (like "left indent"), others can also be applied to certain
characters (like "bold").

So the first type of attributes can only be found in StyleSheets and
ParaAttribs, in addition to attributes of the second type.
CharAttribs can only contain attributes of the second type.

StyleSheets are the things like "heading1", and the user can change both types
of attributes via "Format / Styles and Formatting".

ParaAttribs can be changed via "Format / Paragraph", but normally the user can
only change the first type of attributes there, and doesn't know that the other
attributes can also be contained there.

OOo Accessibility API treats all attributes in StyleSheets+ParaAttribs as
default, and the CharAttribs as run attribs.

This is what users probably expect, but probably nobody expects the
implementation detail that character attributes, which apply to the whole
paragraph, are stored as a ParaAttrib, and therefor are reported as default. 

So we will change the API implementation this way:
Attributes like bold are only treated as "default" when coming from the
StyleSheet, but as a run attribute even when coming from ParaAttribs, in
addition to CharAttribs.

So we don't change the Writer core implementation, where nobody here remembers
why it is done this (strange) way, but the API will report thing as expected.

Since the current behavior is very confusing for AT users, I set the target to
2.4, keyword Accessibility.
Comment 11 malte_timmermann 2007-10-24 12:16:25 UTC
*** Issue 81718 has been marked as a duplicate of this issue. ***
Comment 12 joaniediggs 2007-10-24 16:13:45 UTC
<cite>
So we will change the API implementation this way:
Attributes like bold are only treated as "default" when coming from the
StyleSheet, but as a run attribute even when coming from ParaAttribs, in
addition to CharAttribs.
</cite>

This sounds great -- I think.  :-) One question for clarification/verification:

If I go to Format -> Styles and Formatting and right-click on Default in the
list of paragraph styles, I can change the font to bold so that anything in my
document with the Default paragraph will automatically be bold.  In this case,
would that be a "default" attribute or a run attribute?

Personally, I believe it should be a default attribute.  And I think that's what
you're saying.  But this statement confused me:

<cite>
ParaAttribs can be changed via "Format / Paragraph", but normally the user can
only change the first type of attributes there, and doesn't know that the other
attributes can also be contained there.
</cite>

Thanks!
Comment 13 malte_timmermann 2007-10-24 16:19:55 UTC
Confirmed: Changing the bold attrib in the StyleSheet results in changing the
default, no run attrib.
Comment 14 Oliver-Rainer Wittmann 2007-10-24 16:25:01 UTC
OD->joaniediggs:
It's as you believe/excepted.

The cited statement that confuses you is taken out of context. It belongs to the
stuff MT tries to explain about the different attribute sets at a certain
paragraph in the Writer core.
Comment 15 joaniediggs 2007-10-24 16:38:30 UTC
Thanks guys!  This change should help a lot.
Comment 16 Oliver-Rainer Wittmann 2007-11-13 10:32:16 UTC
fixed in CWS sw8u10bf01 - changed file:
/sw/source/core/access/accpara.cxx, 1.72.60.1

The character attributes found at the attribute set of the paragraph are treated
now as run attributes. Thus, the default character attributes are the ones,
which are found at the paragraph style of the paragraph.
Comment 17 Oliver-Rainer Wittmann 2007-11-21 07:53:18 UTC
OD->ES: fixed in cws sw8u10bf01 - please verify in internal installation set. As
discussed, we will perform this verification together on next Monday (2007-11-26)
Comment 18 eric.savary 2007-12-06 17:09:41 UTC
Verified in CWS sw8u10bf01
Comment 19 thorsten.ziehm 2009-07-20 14:51:59 UTC
This issue is closed automatically and wasn't rechecked in a current version of
OOo. The fixed issue should be integrated in OOo since more than half a year. If
you think this issue isn't fixed in a current version (OOo 3.1), please reopen
it and change the field 'Target Milestone' accordingly.

If you want to download a current version of OOo =>
http://download.openoffice.org/index.html
If you want to know more about the handling of fixed/verified issues =>
http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues