Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358227 - [TextSizeDetermination] Add support for measurement of markup
Summary: [TextSizeDetermination] Add support for measurement of markup
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.5 M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 355861
  Show dependency tree
 
Reported: 2011-09-20 08:09 EDT by Ivan Furnadjiev CLA
Modified: 2012-03-14 03:33 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Furnadjiev CLA 2011-09-20 08:09:24 EDT
In order to support markup in widgets (see bug 355861) we need first to extend the text size determination with a possibility to measure the dimensions of rich text (including images).
Comment 1 Rüdiger Herrmann CLA 2011-09-20 09:14:54 EDT
I would prefer if we could avoid measuring markup on the client. It feels like creating a dependency on browser-based clients.
Comment 2 Ivan Furnadjiev CLA 2011-09-21 03:25:16 EDT
(In reply to comment #1)
> I would prefer if we could avoid measuring markup on the client. It feels like
> creating a dependency on browser-based clients.
But with the current implementation (with or without RichTextToHtmlTransformer) we have this dependency on browser-based (HTML) clients anyway. Rich text (markup) on widgets requires HTML capable client.
Comment 3 Ralf Sternberg CLA 2011-09-22 04:46:39 EDT
(In reply to comment #1)
> I would prefer if we could avoid measuring markup on the client. It feels like
> creating a dependency on browser-based clients.

What would be the alternative to measuring markup?

If we're going to support markup in widgets (even if it's just a bold text range in a label), I think we need to respect the markup in the measurement. Otherwise we'll get cut off text, wrong line wrapping and the like. If a client does not support markup, it would display and measure the text as-is. Applications written for those clients will therefore not use the markup feature anyway.
Comment 4 Ivan Furnadjiev CLA 2012-03-14 03:33:39 EDT
A new internal method TextSizeUtil#markupExtent has been introduced. The measurement mode (string, text or markup) has been included in MeasurementItem and respected in TextSizeStorageUtil key generation. For markup size estimation all <br/> tags are replaced with "\n" and all other tags are removed. Changes are in CVS HEAD.