[webkit-changes] cvs commit: WebCore/khtml/html html_headimpl.cpp html_headimpl.h

Eric eseidel at opensource.apple.com
Tue Nov 29 19:12:01 PST 2005


eseidel     05/11/29 19:12:00

  Modified:    .        ChangeLog
               khtml/html html_headimpl.cpp html_headimpl.h
  Log:
  Bug #: 4403
  Submitted by: mitz
  Reviewed by: darin
          Test: fast/dom/HTMLScriptElement/script-set-src.html
  
          Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=4403
          Script element doesn't load if on set src if already in document
  
          * khtml/html/html_headimpl.cpp:
          (HTMLScriptElementImpl::parseMappedAttribute):
          (HTMLScriptElementImpl::closeRenderer):
          * khtml/html/html_headimpl.h:
  
  Revision  Changes    Path
  1.439     +14 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.438
  retrieving revision 1.439
  diff -u -r1.438 -r1.439
  --- ChangeLog	30 Nov 2005 02:51:51 -0000	1.438
  +++ ChangeLog	30 Nov 2005 03:11:58 -0000	1.439
  @@ -1,5 +1,19 @@
   2005-11-29  Mitz Pettel  <opendarwin.org at mitzpettel.com>
   
  +        Reviewed by darin.
  +
  +        Test: fast/dom/HTMLScriptElement/script-set-src.html
  +
  +        Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=4403
  +        Script element doesn't load if on set src if already in document
  +
  +        * khtml/html/html_headimpl.cpp:
  +        (HTMLScriptElementImpl::parseMappedAttribute):
  +        (HTMLScriptElementImpl::closeRenderer):
  +        * khtml/html/html_headimpl.h:
  +
  +2005-11-29  Mitz Pettel  <opendarwin.org at mitzpettel.com>
  +
           Reviewed by darin.  Committed by eseidel.
   
           Test: fast/table/cell-width-auto.html
  
  
  
  1.60      +29 -0     WebCore/khtml/html/html_headimpl.cpp
  
  Index: html_headimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_headimpl.cpp,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- html_headimpl.cpp	13 Nov 2005 18:52:37 -0000	1.59
  +++ html_headimpl.cpp	30 Nov 2005 03:12:00 -0000	1.60
  @@ -504,6 +504,35 @@
           evaluateScript(getDocument()->URL(), text());
   }
   
  +void HTMLScriptElementImpl::parseMappedAttribute(MappedAttributeImpl *attr)
  +{
  +    if (attr->name() == srcAttr) {
  +        if (m_evaluated || m_cachedScript || m_createdByParser || !inDocument())
  +            return;
  +
  +        // FIXME: Evaluate scripts in viewless documents.
  +        // See http://bugzilla.opendarwin.org/show_bug.cgi?id=5727
  +        if (!getDocument()->part())
  +            return;
  +    
  +        QString url = attr->value().qstring();
  +        if (!url.isEmpty()) {
  +            QString charset = getAttribute(charsetAttr).qstring();
  +            m_cachedScript = getDocument()->docLoader()->requestScript(DOMString(url), charset);
  +            m_cachedScript->ref(this);
  +        }
  +    } else
  +        HTMLElementImpl::parseMappedAttribute(attr);
  +}
  +
  +void HTMLScriptElementImpl::closeRenderer()
  +{
  +    // The parser just reached </script>. If we have no src and no text,
  +    // allow dynamic loading later.
  +    if (getAttribute(srcAttr).isEmpty() && text().isEmpty())
  +        setCreatedByParser(false);
  +}
  +
   void HTMLScriptElementImpl::insertedIntoDocument()
   {
       HTMLElementImpl::insertedIntoDocument();
  
  
  
  1.23      +2 -0      WebCore/khtml/html/html_headimpl.h
  
  Index: html_headimpl.h
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/html/html_headimpl.h,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- html_headimpl.h	8 Nov 2005 08:10:59 -0000	1.22
  +++ html_headimpl.h	30 Nov 2005 03:12:00 -0000	1.23
  @@ -194,6 +194,7 @@
       virtual int tagPriority() const { return 1; }
       virtual bool checkDTD(const NodeImpl* newChild) { return newChild->isTextNode(); }
   
  +    virtual void parseMappedAttribute(MappedAttributeImpl *attr);
       virtual void insertedIntoDocument();
       virtual void removedFromDocument();
       virtual void notifyFinished(khtml::CachedObject *finishedObj);
  @@ -203,6 +204,7 @@
       virtual bool isURLAttribute(AttributeImpl *attr) const;
   
       void setCreatedByParser(bool createdByParser) { m_createdByParser = createdByParser; }
  +    virtual void closeRenderer();
   
       void evaluateScript(const QString &, const DOMString &);
   
  
  
  



More information about the webkit-changes mailing list