Author: hqm
Date: 2007-11-07 19:12:41 -0800 (Wed, 07 Nov 2007)
New Revision: 7192

Modified:
   
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
Log:
Change 20071107-hqm-8 by [EMAIL PROTECTED] on 2007-11-07 21:10:53 EST
    in /cygdrive/c/users/hqm/openlaszlo/trunk/WEB-INF/lps/server/src
    for http://svn.openlaszlo.org/openlaszlo/trunk/WEB-INF/lps/server/src

Summary: prevent compiler warnings when html text content is used

New Features:

Bugs Fixed: LPP-5060

Technical Reviewer: pbr
QA Reviewer: jcrowley
Doc Reviewer: lou

Documentation:

Release Notes:

Details:
    
If an element is marked as being able to have text content, then allow
HTML child elements to be present in text content.


Tests:

see test case in bug report

smokecheck
examples/components/*




Modified: 
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
===================================================================
--- 
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java  
    2007-11-08 02:26:53 UTC (rev 7191)
+++ 
openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java  
    2007-11-08 03:12:41 UTC (rev 7192)
@@ -911,13 +911,16 @@
         for (Iterator iter = element.getChildren().iterator(); iter.hasNext(); 
) {
             ElementWithLocationInfo child = (ElementWithLocationInfo) 
iter.next();
             if (!schema.canContainElement(element.getName(), child.getName())) 
{
-                env.warn(
-                    // TODO [2007-09-26 hqm] i18n this
-                    "The tag '" + child.getName() +
-                    "' cannot be used as a child of " + element.getName(),
-                    element);
+                // If this element is allowed to contain  HTML content, then
+                // we don't want to warn about encountering an HTML child 
element.
+                if (!( schema.hasTextContent(element) && 
schema.isHTMLElement(child))) {
+                    env.warn(
+                        // TODO [2007-09-26 hqm] i18n this
+                        "The tag '" + child.getName() +
+                        "' cannot be used as a child of " + element.getName(),
+                        element);
+                }
             }
-
             try {
                 if (child.getName().equals("data")) {
                     checkChildNameConflict(element.getName(), child, env);


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to