myfaces-commits mailing list archives

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

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


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

commit 2cd8b3fcb0c1710d6fa1919434312ee544387768
Author: Volker Weber <v.weber@inexso.de>
AuthorDate: Tue Sep 15 09:29:21 2020 +0200

    TOBAGO-2054 - tc:object: sandbox attribute
---
 .../main/java/org/apache/myfaces/tobago/component/Attributes.java  | 1 +
 .../apache/myfaces/tobago/internal/component/AbstractUIObject.java | 2 ++
 .../myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java | 5 +++++
 .../tobago/internal/taglib/component/ObjectTagDeclaration.java     | 7 +++++++
 .../org/apache/myfaces/tobago/renderkit/html/HtmlAttributes.java   | 1 +
 5 files changed, 16 insertions(+)

diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
index 2f9d38a..88e1350 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/component/Attributes.java
@@ -356,6 +356,7 @@ public enum Attributes {
   rowSpan,
   rowSpacing,
   rows,
+  sandbox,
   sanitize,
   scriptFiles,
   scrollbarHeight,
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIObject.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIObject.java
index 261996f..ddb2203 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIObject.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUIObject.java
@@ -31,4 +31,6 @@ public abstract class AbstractUIObject extends UIOutput implements Visual
{
   public abstract String getName();
 
   public abstract String getSrc();
+
+  public abstract String getSandbox();
 }
diff --git a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java
b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java
index ea2a4e9..535f9e7 100644
--- a/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java
+++ b/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/renderkit/renderer/ObjectRenderer.java
@@ -57,6 +57,11 @@ public class ObjectRenderer extends RendererBase {
         object.getCustomClass(),
         markup != null && markup.contains(Markup.SPREAD) ? TobagoClass.SPREAD : null);
 
+    String sandbox = object.getSandbox();
+    if (sandbox != null) {
+      writer.writeAttribute(HtmlAttributes.SANDBOX, sandbox, false);
+    }
+
     writer.writeText(ResourceUtils.getString(facesContext, "object.noframe"));
     writer.writeText(" ");
     if (object.getSrc() != null) {
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 d503c44..053734c 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
@@ -68,4 +68,11 @@ public interface ObjectTagDeclaration extends HasIdBindingAndRendered,
IsVisual
   @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 4dca011..2391397 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
@@ -106,6 +106,7 @@ public enum HtmlAttributes implements MarkupLanguageAttributes {
   ROLE("role"),
   ROWS("rows"),
   ROWSPAN("rowspan"),
+  SANDBOX("sandbox"),
   SCROLL("scroll"),
   SELECTED("selected"),
   SIZE("size"),


Mime
View raw message