myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From we...@apache.org
Subject [myfaces-tobago] branch tobago-2.x updated: TOBAGO-2054 - tc:object: sandbox attribute
Date Tue, 15 Sep 2020 07:08:14 GMT
This is an automated email from the ASF dual-hosted git repository.

weber pushed a commit to branch tobago-2.x
in repository https://gitbox.apache.org/repos/asf/myfaces-tobago.git


The following commit(s) were added to refs/heads/tobago-2.x by this push:
     new 6a2107c  TOBAGO-2054 - tc:object: sandbox attribute
6a2107c is described below

commit 6a2107ce9c099d91c107e219adb2e615dfdc109e
Author: Volker Weber <v.weber@inexso.de>
AuthorDate: Tue Sep 15 09:08:06 2020 +0200

    TOBAGO-2054 - tc:object: sandbox attribute
---
 .../tobago/internal/taglib/component/ObjectTagDeclaration.java     | 7 +++++++
 .../org/apache/myfaces/tobago/renderkit/html/HtmlAttributes.java   | 1 +
 .../renderkit/html/standard/standard/tag/ObjectRenderer.java       | 5 +++++
 3 files changed, 13 insertions(+)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java
index b8488d7..d47be20 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/taglib/component/ObjectTagDeclaration.java
@@ -61,4 +61,11 @@ public interface ObjectTagDeclaration extends HasIdBindingAndRendered,
IsGridLay
   @TagAttribute
   @UIComponentTagAttribute
   void setName(String name);
+
+  /**
+   * Value of the iframe sandbox attribute.
+   */
+  @TagAttribute
+  @UIComponentTagAttribute
+  void setSandbox(String sandbox);
 }
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlAttributes.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlAttributes.java
index 73a2e4f..7d6a041 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlAttributes.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/renderkit/html/HtmlAttributes.java
@@ -95,6 +95,7 @@ public final class HtmlAttributes {
   public static final String ROLE = "role";
   public static final String ROWS = "rows";
   public static final String ROWSPAN = "rowspan";
+  public static final String SANDBOX = "sandbox";
   public static final String SCROLL = "scroll";
   public static final String SELECTED = "selected";
   public static final String SIZE = "size";
diff --git a/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java
b/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java
index 0c4aaef..305e9ba 100644
--- a/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java
+++ b/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ObjectRenderer.java
@@ -58,6 +58,11 @@ public class ObjectRenderer extends LayoutComponentRendererBase {
     final Style style = new Style(facesContext, object);
     writer.writeStyleAttribute(style);
 
+    String sandbox = object.getSandbox();
+    if (sandbox != null) {
+      writer.writeAttribute(HtmlAttributes.SANDBOX, sandbox, false);
+    }
+
     String noframes = ResourceManagerUtils.getPropertyNotNull(
         facesContext, "tobago", "browser.noframe.message.prefix");
     writer.writeText(noframes);


Mime
View raw message