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-4.x updated: TOBAGO-2054 - tc:object: sandbox attribute
Date Tue, 15 Sep 2020 07:29:27 GMT
This is an automated email from the ASF dual-hosted git repository.

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


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

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

    TOBAGO-2054 - tc:object: sandbox attribute
---
 .../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 +
 4 files changed, 15 insertions(+)

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 42d4ae0..826061d 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
@@ -60,6 +60,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);
+    }
+
     String noframes = TobagoResourceBundle.getString(facesContext, "browser.noframe.message.prefix");
     writer.writeText(noframes);
     writer.writeText(" ");
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 82f27ac..9243e0d 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
@@ -103,6 +103,7 @@ public enum HtmlAttributes implements MarkupLanguageAttributes {
   ROLE("role"),
   ROWS("rows"),
   ROWSPAN("rowspan"),
+  SANDBOX("sandbox"),
   SCROLL("scroll"),
   SELECTED("selected"),
   SIZE("size"),


Mime
View raw message