<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Aptos;
panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
{font-family:"Iosevka Fixed SS16";
panose-1:2 0 5 9 3 0 0 0 0 4;}
@font-face
{font-family:"Times New Roman \(Body CS\)";
panose-1:2 11 6 4 2 2 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:10.0pt;
font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Iosevka Fixed SS16";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">Pavel:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">I think your comments in the ticket are still invisible to me, so I can't comment.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">About your recent comment in the PR - I have difficulty understanding what you mean. We are not adding methods to "style individual properties". We are adding methods that
allow the application to use CSS to style parts of the visual representation of the given RichParagraph.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">Perhaps if you describe what kind of visual representation you have in mind, we can show how to achieve that in the code.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16"">-andy<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Iosevka Fixed SS16""><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">openjfx-dev <openjfx-dev-retn@openjdk.org> on behalf of PavelTurk <pavelturk2000@gmail.com><br>
<b>Date: </b>Thursday, May 8, 2025 at 11:04<br>
<b>To: </b>openjfx-dev@openjdk.org <openjfx-dev@openjdk.org><br>
<b>Subject: </b>Re: RFR: 8355774: RichTextArea: provide mechanism for CSS styling of highlights<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt">I am not a member of the JavaFX team, but if I may, I’d like to express my opinion. I believe that creating separate<br>
methods for styling individual properties is a very problematic and dangerous decision.<br>
<br>
First, the usefulness of such methods is minimal because when styling is done via CSS, the assumption is that<br>
adjusting the CSS file should be sufficient—something that won’t work in this case. For example one user for search<br>
result wants to set background color for matches but another one wants to set foreground color + weight.<br>
Second, it violates fundamental CSS principles. Third, if these methods are added to the API, they cannot later<br>
be removed without breaking backward compatibility.<br>
<br>
I wrote about this in detail in the additional information for JDK-8356436, but my comment has not yet been approved<br>
by a moderator.<br>
<br>
When in doubt, it’s very helpful to see how others are doing it. In RichTextFX, special CSS properties were introduced,<br>
which resulted in a consistent standard for applying CSS styles to all properties—fully aligned with established CSS norms.<br>
<br>
This is my personal opinion, which, of course, can be wrong.<br>
<br>
Best regards, Pavel<br>
<br>
On 5/8/25 20:46, Andy Goryachev wrote:<br>
> Adding missing APIs related to styling the highlights with CSS:<br>
><br>
> <br>
><br>
><br>
><br>
> Adds methods to the `RichParagraph.Builder`:<br>
><br>
><br>
> /**<br>
> * Adds a wavy underline (typically used as a spell checker indicator) with the specified style name(s).<br>
> * <p><br>
> * The corresponding styles should define CSS properties applicable to {@link javafx.scene.shape.Path}.<br>
> *<br>
> * @param start the start offset<br>
> * @param length the end offset<br>
> * @param css the style name(s)<br>
> * @return this {@code Builder} instance<br>
> * @since 25<br>
> */<br>
> public Builder addWavyUnderline(int start, int length, String ... css) {<br>
><br>
><br>
><br>
> /**<br>
> * Adds a highlight with the specified style name(s).<br>
> * Use translucent colors to enable multiple highlights in the same region of text.<br>
> * <p><br>
> * The corresponding styles should define CSS properties applicable to {@link javafx.scene.shape.Path}.<br>
> *<br>
> * @param start the start offset<br>
> * @param length the end offset<br>
> * @param css the style name(s)<br>
> * @return this {@code Builder} instance<br>
> * @since 25<br>
> */<br>
> public Builder addHighlight(int start, int length, String ... css) {<br>
><br>
><br>
><br>
> Also adding similar methods to the `SimpleViewOnlyStyledModel` class:<br>
><br>
><br>
> /**<br>
> * Adds a highlight of the given color to the specified range within the last paragraph,<br>
> * with the specified style name(s).<br>
> *<br>
> * @param start the start offset<br>
> * @param length the length of the highlight<br>
> * @param css the highlight style name(s)<br>
> * @return this model instance<br>
> * @since 25<br>
> */<br>
> public SimpleViewOnlyStyledModel highlight(int start, int length, String ... css) {<br>
><br>
><br>
> /**<br>
> * Adds a wavy underline (typically used as a spell checker indicator)<br>
> * to the specified range within the last paragraph, with the specified style name(s).<br>
> *<br>
> * @param start the start offset<br>
> * @param length the length of the highlight<br>
> * @param css the highlight style name(s)<br>
> * @return this model instance<br>
> * @since 25<br>
> */<br>
> public SimpleViewOnlyStyledModel addWavyUnderline(int start, int length, String ... css) {<br>
><br>
> -------------<br>
><br>
> Commit messages:<br>
> - tab<br>
> - css<br>
><br>
> Changes: <a href="https://git.openjdk.org/jfx/pull/1802/files">https://git.openjdk.org/jfx/pull/1802/files</a><br>
> Webrev: <a href="https://webrevs.openjdk.org/?repo=jfx&pr=1802&range=00">https://webrevs.openjdk.org/?repo=jfx&pr=1802&range=00</a><br>
> Issue: <a href="https://bugs.openjdk.org/browse/JDK-8355774">https://bugs.openjdk.org/browse/JDK-8355774</a><br>
> Stats: 128 lines in 4 files changed: 110 ins; 8 del; 10 mod<br>
> Patch: <a href="https://git.openjdk.org/jfx/pull/1802.diff">https://git.openjdk.org/jfx/pull/1802.diff</a><br>
> Fetch: git fetch <a href="https://git.openjdk.org/jfx.git">https://git.openjdk.org/jfx.git</a> pull/1802/head:pull/1802<br>
><br>
> PR: <a href="https://git.openjdk.org/jfx/pull/1802">https://git.openjdk.org/jfx/pull/1802</a><o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>