You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2020/12/11 07:54:28 UTC

[myfaces-tobago] 13/22: TOBAGO-2054 - tc:object: sandbox attribute

This is an automated email from the ASF dual-hosted git repository.

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

commit cdb9ac6adbb621c28dae2a4a6d0ce8dcae7e53b0
Author: Volker Weber <v....@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);