Return-Path: X-Original-To: apmail-myfaces-dev-archive@www.apache.org Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 164B2EB26 for ; Mon, 25 Feb 2013 16:46:45 +0000 (UTC) Received: (qmail 66235 invoked by uid 500); 25 Feb 2013 16:46:44 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 65847 invoked by uid 500); 25 Feb 2013 16:46:44 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 65835 invoked by uid 99); 25 Feb 2013 16:46:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2013 16:46:44 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mkienenb@gmail.com designates 209.85.212.175 as permitted sender) Received: from [209.85.212.175] (HELO mail-wi0-f175.google.com) (209.85.212.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 25 Feb 2013 16:46:36 +0000 Received: by mail-wi0-f175.google.com with SMTP id l13so3669254wie.8 for ; Mon, 25 Feb 2013 08:46:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=+dqjRz53X7eo9YuPZ+XIAeTlz/XxOJvdOSR8cfY3fVg=; b=NsiRo+C4WbDpQQHRZF284uRzjVeG0a7LDkOPrb3AfPDSCYQB9fUm6I24mYwLa1PWQv s2F2yv3kgviYDDnly/LFi1DPDTq2rNaaOqLJrLGg+D9IVHRjM1rkB9eqBHw1EbI1i2xh ICOX3j0XT7whs+FocAEjWNYsv/ivQb46mixzqAtrJGdFBwSjBnJO6slEzLjfbskKMnPy VkUL0RpOP/nE8sK7KENuyh8V3r8u0kPqWp+1PGVmTda8ELtyU6m54f4a8Nb5kAwdoOba HtfIl2wgN4AxG4LtU3846pLrZCctq2BlOGi6jHuYBor9kEFR67jr+N1RR8GkN5FVLdBD EFPg== X-Received: by 10.194.235.196 with SMTP id uo4mr20402032wjc.30.1361810776181; Mon, 25 Feb 2013 08:46:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.214.203 with HTTP; Mon, 25 Feb 2013 08:45:56 -0800 (PST) In-Reply-To: References: From: Mike Kienenberger Date: Mon, 25 Feb 2013 11:45:56 -0500 Message-ID: Subject: Re: duplicate h:body onload (and probably onunload) attributes rendered when isCommonPropertiesOptimizationEnabled is true To: MyFaces Development Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Is trunk still 2.1? I'm guessing I want to fix this on trunk, 2.0.x and 2.2.x On Mon, Feb 25, 2013 at 11:39 AM, Leonardo Uribe wrote: > Hi > > Yes, the solution seems correct. > > regards, > > Leonardo Uribe > > 2013/2/25 Mike Kienenberger : >> Ok. Looking at the constants, the solution is probably to replace >> HTML.BODY_ATTRIBUTES with BODY_ATTRIBUTES_WITHOUT_EVENTS. I should >> have looked at the other available constants first. >> >> >> On Mon, Feb 25, 2013 at 11:30 AM, Mike Kienenberger wrote: >>> I've noticed this for some time in the MyFaces 2.1 code, but haven't >>> taken the time to look into it until recently. >>> >>> HtmlBodyRendererBase renders onload and onunload, but then renders it >>> a second time when isCommonPropertiesOptimizationEnabled() is true. >>> This is not the same issue as MYFACES-2630 where HTML.ONUNLOAD_ATTR >>> was misdefined as "onload". >>> >>> This appears to be because HTML.BODY_ATTRIBUTES contains onload and >>> onunload and these are unconditionally rendered a second time. >>> >>> I'm not sure what the solution should be. My guess is that we just >>> need to stop re-rendering the onload onunload attributes in the >>> optimized section. I'm not sure if we can change the contents of >>> BODY_ATTRIBUTES. It seems odd that passthrough attributes contains >>> more attributes than body attributes as replacing HTML.BODY_ATTRIBUTES >>> with HTML.BODY_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS was my first >>> though. >>> >>> HTML.BODY_ATTRIBUTES contains [onload, onunload, alink, vlink, link, >>> text, background, bgcolor] >>> HTML.BODY_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS contains [dir, lang, >>> title, style, styleClass, alink, vlink, link, text, background, >>> bgcolor] >>> >>> HtmlRendererUtils.renderBehaviorizedAttribute(facesContext, >>> writer, HTML.ONLOAD_ATTR, component, >>> ClientBehaviorEvents.LOAD, behaviors, HTML.ONLOAD_ATTR); >>> HtmlRendererUtils.renderBehaviorizedAttribute(facesContext, >>> writer, HTML.ONUNLOAD_ATTR, component, >>> ClientBehaviorEvents.UNLOAD, behaviors, HTML.ONUNLOAD_ATTR); >>> >>> if (isCommonPropertiesOptimizationEnabled(facesContext)) >>> { >>> HtmlRendererUtils.renderHTMLAttributes(writer, component, >>> HTML.BODY_ATTRIBUTES); >>> >>> CommonPropertyUtils.renderCommonPassthroughPropertiesWithoutEvents(writer, >>> >>> CommonPropertyUtils.getCommonPropertiesMarked(component), component); >>> } >>> else >>> { >>> HtmlRendererUtils.renderHTMLAttributes(writer, component, >>> HTML.BODY_PASSTHROUGH_ATTRIBUTES_WITHOUT_EVENTS); >>> }