- From: Maciej Stachowiak <mjs@apple.com>
- Date: Tue, 3 Jan 2006 13:20:40 -0800
- To: Antoine Quint <ml@graougraou.com>
- Cc: www-svg@w3.org
On Jan 3, 2006, at 11:45 AM, Antoine Quint wrote:
> On 3 janv. 2006, at 19:37, Ian Hickson wrote:
>
>>> With existing DOM:
>>
>> function highlightButton(bHighlight) {
>> var nHighlight = (bHighlight ? : 20 : -20);
>> var ele = document.getElementById("buttonSurface");
>> var color = getComputedStyle(ele, '').getPropertyCSSValue
>> ('fill').getRGBColorValue();
>> document.getOverrideStyle(ele, '').setProperty('fill', 'rgb(' +
>> (color.red + nHighlight) + ', ' +
>> (color.green + nHighlight) + ', ' +
>> (color.blue + nHighlight) + ')');
>> }
>
> This requires a fair ammount of string manipulations, exactly the
> kind of things that the SVG WG was trying to avoid spec'ing out
> mobile-friendly APIs.
The only string manipulation required is to build the color string -
granted this is annoying but actually doesn't come out more complex
either codewise or computationally than creating an SVGRGBColor. But
it's true that it does not meet a goal of minimizing string
manipulation.
>
>> (There are plans for making big improvements to the CSSOM which would
>> reduce this to:
>>
>> function highlightButton(bHighlight) {
>> var nHighlight = (bHighlight ? : 20 : -20);
>> var ele = document.getElementById("buttonSurface");
>> var color = ele.runtimeStyle.color;
>> color.red += nHighlight;
>> color.green += nHighlight;
>> color.blue += nHighlight;
>> }
>>
>> ...but they have not been specced out yet.)
>
> So they're out of scope for this debate since they're not "existing
> DOM technology".
I think this example is relevant. It addresses the question of
whether uDOM is an appropriate technology for UAs that also implement
a full DOM, which was the original question at issue. For full DOM,
forthcoming enhancements to the CSSOM like this are a better fit than
adding a completely separate mechanism like traits.
Regards,
Maciej
Received on Tuesday, 3 January 2006 21:20:48 UTC