[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:56:43 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 85fdef44d09295c2979c6b0fd095d71741e0937d
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 19 23:55:42 2003 +0000

            Reviewed by Dave.
    
            - update layout tests for Dave's change
    
            * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
            * layout-tests/fast/block/positioning/051-expected.txt:
            * layout-tests/fast/overflow/003-expected.txt:
    
            - fixed 3426272 -- sites that use text-shadow cause leaks (QPainter::setShadow)
    
            * kwq/KWQPainter.mm: (QPainter::setShadow): Release the color space and color.
    
            - fixed some errors that caused failures in the W3C DOM suite
    
            * khtml/ecma/kjs_binding.cpp:
            (DOMObject::get): Put "code" in the error object.
            (DOMObject::put): Put "code" in the error object.
            (DOMFunction::get): Put "code" in the error object.
    
            * khtml/ecma/kjs_dom.cpp: (DOMCharacterDataProtoFunc::tryCall):
            Add checks for negative count values. Not clear whether this change is
            really great, but it helps us pass W3C DOM tests and clearly won't affect
            normal pages in any bad way.
    
            * khtml/xml/dom_elementimpl.cpp:
            (AttrImpl::AttrImpl): Set m_specified to true. Since we never set up the
            attributes from the DTD anyway, this is fine for now. If we ever go crazy
            and implement that, then the bit field is sitting here waiting for us.
            (NamedAttrMapImpl::removeNamedItem): The comment from KHTML says they
            don't raise the not found exception because "the DOM 2 spec doesn't say
            you should". But the DOM Level 1 specification clearly does, and the W3C
            DOM Level 1 Core test requires it, so I'm putting it in.
    
            * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkAddChild): Typo; this was
            returning the wrong error code in the "wrong document" case.
    
            * khtml/xml/dom_stringimpl.cpp:
            (DOMStringImpl::remove): Fix overflow case.
            (DOMStringImpl::substring): Fix overflow case.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5011 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/fast/block/positioning/051-expected.txt b/LayoutTests/fast/block/positioning/051-expected.txt
index 6187d36..8ec60fa 100644
--- a/LayoutTests/fast/block/positioning/051-expected.txt
+++ b/LayoutTests/fast/block/positioning/051-expected.txt
@@ -25,14 +25,14 @@ layer at (82,842) size 519x200
   RenderBlock (positioned) zI: -3 {P} at (60,60) size 200x200 [color=#FFFFFF] [bgcolor=#990066]
     RenderText zI: -3 {TEXT} at (50,41) size 469x80
       text run at (50,41) width 469: "\x{A0}8\x{A0}hide\x{A0}me"
-layer at (32,2894) size 200x200
-  RenderBlock (positioned) zI: -3 {P} at (10,210) size 200x200 [color=#FFFFFF] [bgcolor=#660099]
-    RenderText zI: -3 {TEXT} at (71,41) size 57x80
-      text run at (71,41) width 57: "7"
 layer at (82,2744) size 200x200
   RenderBlock (positioned) zI: -3 {P} at (60,60) size 200x200 [color=#FFFFFF] [bgcolor=#990066]
     RenderText zI: -3 {TEXT} at (71,41) size 57x80
       text run at (71,41) width 57: "8"
+layer at (32,2894) size 200x200
+  RenderBlock (positioned) zI: -3 {P} at (10,210) size 200x200 [color=#FFFFFF] [bgcolor=#660099]
+    RenderText zI: -3 {TEXT} at (71,41) size 57x80
+      text run at (71,41) width 57: "7"
 layer at (82,3378) size 200x200
   RenderBlock (positioned) zI: -3 {P} at (60,60) size 200x200 [color=#FFFFFF] [bgcolor=#990066]
     RenderText zI: -3 {TEXT} at (71,41) size 57x80
@@ -49,14 +49,14 @@ layer at (32,992) size 200x200
   RenderBlock (positioned) zI: -2 {P} at (10,210) size 200x200 [color=#FFFFFF] [bgcolor=#660099]
     RenderText zI: -2 {TEXT} at (71,41) size 57x80
       text run at (71,41) width 57: "7"
-layer at (232,2460) size 200x200
-  RenderBlock (positioned) zI: -2 {P} at (210,410) size 200x200 [color=#FFFFFF] [bgcolor=#009999]
-    RenderText zI: -2 {TEXT} at (71,41) size 57x80
-      text run at (71,41) width 57: "5"
 layer at (82,2410) size 200x200
   RenderBlock (positioned) zI: -2 {P} at (60,360) size 200x200 [color=#FFFFFF] [bgcolor=#0000FF]
     RenderText zI: -2 {TEXT} at (71,41) size 57x80
       text run at (71,41) width 57: "6"
+layer at (232,2460) size 200x200
+  RenderBlock (positioned) zI: -2 {P} at (210,410) size 200x200 [color=#FFFFFF] [bgcolor=#009999]
+    RenderText zI: -2 {TEXT} at (71,41) size 57x80
+      text run at (71,41) width 57: "5"
 layer at (32,3528) size 200x200
   RenderBlock (positioned) zI: -2 {P} at (10,210) size 200x200 [color=#FFFFFF] [bgcolor=#660099]
     RenderText zI: -2 {TEXT} at (71,41) size 57x80
diff --git a/LayoutTests/fast/overflow/003-expected.txt b/LayoutTests/fast/overflow/003-expected.txt
index 26594b0..b175aa7 100644
--- a/LayoutTests/fast/overflow/003-expected.txt
+++ b/LayoutTests/fast/overflow/003-expected.txt
@@ -1,4 +1,4 @@
 layer at (0,0) size 0x0
   RenderCanvas at (0,0) size 0x0
-layer at (0,-500000) size 0x0 backgroundClip at (0,0) size 0x-500000 clip at (0,0) size 0x0
+layer at (0,-500000) size 0x0 backgroundClip at (0,0) size 0x0 clip at (0,0) size 0x0
   RenderBlock {COMMENT} at (0,-500000) size 0x0
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index bd4a785..33b6385 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,45 @@
+2003-09-19  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
+        - update layout tests for Dave's change
+
+        * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
+        * layout-tests/fast/block/positioning/051-expected.txt:
+        * layout-tests/fast/overflow/003-expected.txt:
+
+        - fixed 3426272 -- sites that use text-shadow cause leaks (QPainter::setShadow)
+
+        * kwq/KWQPainter.mm: (QPainter::setShadow): Release the color space and color.
+
+        - fixed some errors that caused failures in the W3C DOM suite
+
+        * khtml/ecma/kjs_binding.cpp:
+        (DOMObject::get): Put "code" in the error object.
+        (DOMObject::put): Put "code" in the error object.
+        (DOMFunction::get): Put "code" in the error object.
+
+        * khtml/ecma/kjs_dom.cpp: (DOMCharacterDataProtoFunc::tryCall):
+        Add checks for negative count values. Not clear whether this change is
+        really great, but it helps us pass W3C DOM tests and clearly won't affect
+        normal pages in any bad way.
+
+        * khtml/xml/dom_elementimpl.cpp:
+        (AttrImpl::AttrImpl): Set m_specified to true. Since we never set up the
+        attributes from the DTD anyway, this is fine for now. If we ever go crazy
+        and implement that, then the bit field is sitting here waiting for us.
+        (NamedAttrMapImpl::removeNamedItem): The comment from KHTML says they
+        don't raise the not found exception because "the DOM 2 spec doesn't say
+        you should". But the DOM Level 1 specification clearly does, and the W3C
+        DOM Level 1 Core test requires it, so I'm putting it in.
+
+        * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkAddChild): Typo; this was
+        returning the wrong error code in the "wrong document" case.
+
+        * khtml/xml/dom_stringimpl.cpp:
+        (DOMStringImpl::remove): Fix overflow case.
+        (DOMStringImpl::substring): Fix overflow case.
+        
 2003-09-19  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3401409, fix negative z-index.  This code actually substantially
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index bd4a785..33b6385 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,45 @@
+2003-09-19  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
+        - update layout tests for Dave's change
+
+        * layout-tests/apple-only/base/www.excite.com/index-expected.txt:
+        * layout-tests/fast/block/positioning/051-expected.txt:
+        * layout-tests/fast/overflow/003-expected.txt:
+
+        - fixed 3426272 -- sites that use text-shadow cause leaks (QPainter::setShadow)
+
+        * kwq/KWQPainter.mm: (QPainter::setShadow): Release the color space and color.
+
+        - fixed some errors that caused failures in the W3C DOM suite
+
+        * khtml/ecma/kjs_binding.cpp:
+        (DOMObject::get): Put "code" in the error object.
+        (DOMObject::put): Put "code" in the error object.
+        (DOMFunction::get): Put "code" in the error object.
+
+        * khtml/ecma/kjs_dom.cpp: (DOMCharacterDataProtoFunc::tryCall):
+        Add checks for negative count values. Not clear whether this change is
+        really great, but it helps us pass W3C DOM tests and clearly won't affect
+        normal pages in any bad way.
+
+        * khtml/xml/dom_elementimpl.cpp:
+        (AttrImpl::AttrImpl): Set m_specified to true. Since we never set up the
+        attributes from the DTD anyway, this is fine for now. If we ever go crazy
+        and implement that, then the bit field is sitting here waiting for us.
+        (NamedAttrMapImpl::removeNamedItem): The comment from KHTML says they
+        don't raise the not found exception because "the DOM 2 spec doesn't say
+        you should". But the DOM Level 1 specification clearly does, and the W3C
+        DOM Level 1 Core test requires it, so I'm putting it in.
+
+        * khtml/xml/dom_nodeimpl.cpp: (NodeImpl::checkAddChild): Typo; this was
+        returning the wrong error code in the "wrong document" case.
+
+        * khtml/xml/dom_stringimpl.cpp:
+        (DOMStringImpl::remove): Fix overflow case.
+        (DOMStringImpl::substring): Fix overflow case.
+        
 2003-09-19  David Hyatt  <hyatt at apple.com>
 
 	Fix for 3401409, fix negative z-index.  This code actually substantially
diff --git a/WebCore/khtml/ecma/kjs_binding.cpp b/WebCore/khtml/ecma/kjs_binding.cpp
index 38ee91a..d020524 100644
--- a/WebCore/khtml/ecma/kjs_binding.cpp
+++ b/WebCore/khtml/ecma/kjs_binding.cpp
@@ -50,6 +50,7 @@ Value DOMObject::get(ExecState *exec, const Identifier &p) const
     // ### oh, and s/QString/i18n or I18N_NOOP (the code in kjs uses I18N_NOOP... but where is it translated ?)
     //     and where does it appear to the user ?
     Object err = Error::create(exec, GeneralError, QString("DOM exception %1").arg(e.code).local8Bit());
+    err.put(exec, "code", Number(e.code));
     exec->setException( err );
     result = Undefined();
   }
@@ -69,6 +70,7 @@ void DOMObject::put(ExecState *exec, const Identifier &propertyName,
   }
   catch (DOM::DOMException e) {
     Object err = Error::create(exec, GeneralError, QString("DOM exception %1").arg(e.code).local8Bit());
+    err.put(exec, "code", Number(e.code));
     exec->setException(err);
   }
   catch (...) {
@@ -90,6 +92,7 @@ Value DOMFunction::get(ExecState *exec, const Identifier &propertyName) const
   catch (DOM::DOMException e) {
     result = Undefined();
     Object err = Error::create(exec, GeneralError, QString("DOM exception %1").arg(e.code).local8Bit());
+    err.put(exec, "code", Number(e.code));
     exec->setException(err);
   }
   catch (...) {
diff --git a/WebCore/khtml/ecma/kjs_dom.cpp b/WebCore/khtml/ecma/kjs_dom.cpp
index 7c41446..463929a 100644
--- a/WebCore/khtml/ecma/kjs_dom.cpp
+++ b/WebCore/khtml/ecma/kjs_dom.cpp
@@ -41,6 +41,8 @@
 
 using namespace KJS;
 
+using DOM::DOMException;
+
 // -------------------------------------------------------------------------
 /* Source for DOMNodeProtoTable. Use "make hashtables" to regenerate.
 @begin DOMNodeProtoTable 13
@@ -1630,24 +1632,32 @@ Value DOMCharacterDataProtoFunc::tryCall(ExecState *exec, Object &thisObj, const
   }
   DOM::CharacterData data = static_cast<DOMCharacterData *>(thisObj.imp())->toData();
   switch(id) {
-    case DOMCharacterData::SubstringData:
-      return getStringOrNull(data.substringData(args[0].toInteger(exec),args[1].toInteger(exec)));
+    case DOMCharacterData::SubstringData: {
+      const int count = args[1].toInteger(exec);
+      if (count < 0)
+        throw DOMException(DOMException::INDEX_SIZE_ERR);
+      return getStringOrNull(data.substringData(args[0].toInteger(exec), count));
+    }
     case DOMCharacterData::AppendData:
       data.appendData(args[0].toString(exec).string());
       return Undefined();
-      break;
     case DOMCharacterData::InsertData:
-      data.insertData(args[0].toInteger(exec),args[1].toString(exec).string());
-      return  Undefined();
-      break;
-    case DOMCharacterData::DeleteData:
-      data.deleteData(args[0].toInteger(exec),args[1].toInteger(exec));
-      return  Undefined();
-      break;
-    case DOMCharacterData::ReplaceData:
-      data.replaceData(args[0].toInteger(exec),args[1].toInteger(exec),args[2].toString(exec).string());
+      data.insertData(args[0].toInteger(exec), args[1].toString(exec).string());
       return Undefined();
-      break;
+    case DOMCharacterData::DeleteData: {
+      const int count = args[1].toInteger(exec);
+      if (count < 0)
+        throw DOMException(DOMException::INDEX_SIZE_ERR);
+      data.deleteData(args[0].toInteger(exec), count);
+      return Undefined();
+    }
+    case DOMCharacterData::ReplaceData: {
+      const int count = args[1].toInteger(exec);
+      if (count < 0)
+        throw DOMException(DOMException::INDEX_SIZE_ERR);
+      data.replaceData(args[0].toInteger(exec), count, args[2].toString(exec).string());
+      return Undefined();
+    }
     default:
       return Undefined();
   }
diff --git a/WebCore/khtml/xml/dom_elementimpl.cpp b/WebCore/khtml/xml/dom_elementimpl.cpp
index 5d633a6..375e086 100644
--- a/WebCore/khtml/xml/dom_elementimpl.cpp
+++ b/WebCore/khtml/xml/dom_elementimpl.cpp
@@ -58,6 +58,7 @@ AttrImpl::AttrImpl(ElementImpl* element, DocumentPtr* docPtr, AttributeImpl* a)
     assert(!m_attribute->_impl);
     m_attribute->_impl = this;
     m_attribute->ref();
+    m_specified = true;
 }
 
 AttrImpl::~AttrImpl()
@@ -619,6 +620,9 @@ Node NamedAttrMapImpl::setNamedItem ( NodeImpl* arg, int &exceptioncode )
 
 // The DOM2 spec doesn't say that removeAttribute[NS] throws NOT_FOUND_ERR
 // if the attribute is not found - David
+// But the DOM Level 1 document does say that:
+// http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-core#ID-D58B193
+// and the DOM test suite from W3C checks that case, so I'm going with that. - Darin
 Node NamedAttrMapImpl::removeNamedItem ( NodeImpl::Id id, int &exceptioncode )
 {
     // ### should this really be raised when the attribute to remove isn't there at all?
@@ -629,7 +633,10 @@ Node NamedAttrMapImpl::removeNamedItem ( NodeImpl::Id id, int &exceptioncode )
     }
 
     AttributeImpl* a = getAttributeItem(id);
-    if (!a) return Node();
+    if (!a) {
+        exceptioncode = DOMException::NOT_FOUND_ERR;
+        return Node();
+    }
 
     if (!a->attrImpl())  a->allocateImpl(element);
     Node r(a->attrImpl());
diff --git a/WebCore/khtml/xml/dom_nodeimpl.cpp b/WebCore/khtml/xml/dom_nodeimpl.cpp
index 2431707..0ba429c 100644
--- a/WebCore/khtml/xml/dom_nodeimpl.cpp
+++ b/WebCore/khtml/xml/dom_nodeimpl.cpp
@@ -865,7 +865,7 @@ void NodeImpl::checkAddChild(NodeImpl *newChild, int &exceptioncode)
     // We assume that if newChild is a DocumentFragment, all children are created from the same document
     // as the fragment itself (otherwise they could not have been added as children)
     if (newChild->getDocument() != getDocument()) {
-        exceptioncode = DOMException::NO_MODIFICATION_ALLOWED_ERR;
+        exceptioncode = DOMException::WRONG_DOCUMENT_ERR;
         return;
     }
 
diff --git a/WebCore/khtml/xml/dom_stringimpl.cpp b/WebCore/khtml/xml/dom_stringimpl.cpp
index 1ef065e..f47d553 100644
--- a/WebCore/khtml/xml/dom_stringimpl.cpp
+++ b/WebCore/khtml/xml/dom_stringimpl.cpp
@@ -103,8 +103,9 @@ void DOMStringImpl::truncate(int len)
 
 void DOMStringImpl::remove(uint pos, int len)
 {
+  if(len <= 0) return;
   if(pos >= l ) return;
-  if(pos+len > l)
+  if((unsigned)len > l - pos)
     len = l - pos;
 
   uint newLen = l-len;
@@ -149,7 +150,7 @@ bool DOMStringImpl::containsOnlyWhitespace() const
 DOMStringImpl *DOMStringImpl::substring(uint pos, uint len)
 {
   if( pos >=l ) return new DOMStringImpl();
-  if(pos+len > l)
+  if(len > l - pos)
     len = l - pos;
 
   return new DOMStringImpl(s + pos, len);
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index 561b074..beba3b9 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -638,11 +638,14 @@ void QPainter::setShadow(int x, int y, int blur, const QColor& color)
         float alpha = [deviceColor alphaComponent];
         const float components[] = { red, green, blue, alpha };
         
+        CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+        CGColorRef color = CGColorCreate(colorSpace, components);
+        CGColorSpaceRelease(colorSpace);
         CGContextSetShadowWithColor(context,
                                     CGSizeMake(x,-y), // y is flipped.
                                     blur, 
-                                    CGColorCreate(CGColorSpaceCreateDeviceRGB(),
-                                                  components));
+                                    color);
+        CGColorRelease(color);
     }
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list