JDK-8089283 : Padding property of the select tag is incorrect in WebView
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version: 8u20
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-09-29
  • Updated: 2017-10-11
  • Resolved: 2017-06-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 10 JDK 8 JDK 9
10Fixed 8u151Fixed 9.0.1Fixed
Padding property of the select tag is incorrect in WebView.
left and right���property is ignored.

test code:

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebView;
import javafx.stage.Stage;

public class SelectTagPaddingTest extends Application{

	public void start(Stage stage) throws Exception {
		StackPane pane = new StackPane();
		WebView browser = new WebView();
				+ "<select style='padding:1em 1em 1em 1em'><option>AAAAAAAAAA<option>BBBBBBBBBBB<option>CCCCCCCCCCC</select><br>"
				+ "<select style='padding:1em 0em 0em 0em'><option>AAAAAAAAAA<option>BBBBBBBBBBB<option>CCCCCCCCCCC</select><br>"
				+ "<select style='padding:0em 1em 0em 0em'><option>AAAAAAAAAA<option>BBBBBBBBBBB<option>CCCCCCCCCCC</select><br>"
				+ "<select style='padding:0em 0em 1em 0em'><option>AAAAAAAAAA<option>BBBBBBBBBBB<option>CCCCCCCCCCC</select><br>"
				+ "<select style='padding:0em 0em 0em 1em'><option>AAAAAAAAAA<option>BBBBBBBBBBB<option>CCCCCCCCCCC</select><br>"
				+ "</body></html>");
		Scene scene = new Scene(pane);

	public static void main(String[] args){

Changeset: 1440a5c6d810 Author: asrivastava Date: 2017-06-14 14:44 +0530 URL: http://hg.openjdk.java.net/openjfx/10-dev/rt/rev/1440a5c6d810 8089283: Padding property of the select tag is incorrect in WebView Reviewed-by: ghb, arajkumar Contributed-by: dipak.kumar@oracle.com

Thanks Arun and Guru. Updated webrev after incorporating review comments - http://cr.openjdk.java.net/~asrivastava/dipak/8089283/webrev.01/

+1, Along with above comments, Do run DRT test.

lgtm with nits: I prefer to write in the below format unless other reviewers disagrees :) style.setPaddingRight(Length(20f + style.paddingRight().value(), Fixed)); style.setPaddingLeft(Length(2f + style.paddingLeft().value(), Fixed)); Is there any DRT test case covers this scenario? Otherwise we should consider adding one.

Webrev for proposed fix - http://cr.openjdk.java.net/~asrivastava/dipak/8089283/webrev.00/

The padding property also seems to be ignored in <table> <td> elements. UPDATE: this rule is *not* effective: td { padding: 10px; } this rule *is* effective: td { padding: 10px !important; } I guess I don't understand the cascading path for table cells.