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

Bug 358227

Summary: [TextSizeDetermination] Add support for measurement of markup
Product: [RT] RAP Reporter: Ivan Furnadjiev <ivan>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 1.5   
Target Milestone: 1.5 M6   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 355861    

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.