LayoutTests:
authorkmccullo <kmccullo@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Feb 2007 01:35:05 +0000 (01:35 +0000)
committerkmccullo <kmccullo@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Feb 2007 01:35:05 +0000 (01:35 +0000)
        Reviewed by .

        - reverting change to not cause regressions and performance problems.

        * fast/loader/local-JavaScript-from-local-expected.txt: Removed.
        * fast/loader/local-JavaScript-from-local.html: Removed.
        * fast/loader/local-iFrame-source-from-local-expected.txt: Removed.
        * fast/loader/local-iFrame-source-from-local.html: Removed.
        * fast/loader/local-image-from-local-expected.txt: Removed.
        * fast/loader/local-image-from-local.html: Removed.

WebCore:

        Reviewed by .

        - reverting change to not cause regressions and performance problems.

        * bindings/objc/DOM.mm:
        (-[DOMElement image]):
        (-[DOMElement _imageTIFFRepresentation]):
        * dom/XMLTokenizer.cpp:
        (WebCore::XMLTokenizer::notifyFinished):
        * html/HTMLImageLoader.cpp:
        (WebCore::HTMLImageLoader::dispatchLoadEvent):
        * html/HTMLTokenizer.cpp:
        (WebCore::HTMLTokenizer::reset):
        (WebCore::HTMLTokenizer::notifyFinished):
        * ksvg2/misc/SVGImageLoader.cpp:
        (WebCore::SVGImageLoader::dispatchLoadEvent):
        * loader/Cache.cpp:
        (WebCore::Cache::requestResource):
        (WebCore::Cache::remove):
        * loader/CachedImage.h:
        (WebCore::CachedImage::canRender):
        (WebCore::CachedImage::isErrorImage):
        * loader/CachedResource.h:
        * loader/CachedScript.h:
        (WebCore::CachedScript::errorOccurred):
        * loader/DocLoader.cpp:
        (WebCore::DocLoader::requestResource):
        (WebCore::DocLoader::setLoadInProgress):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::canLoad):
        * page/EventHandler.cpp:
        (WebCore::selectCursor):
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::image):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::setCachedImage):
        (WebCore::RenderImage::imageChanged):
        (WebCore::RenderImage::paint):
        (WebCore::RenderImage::layout):
        (WebCore::RenderImage::calcAspectRatioWidth):
        (WebCore::RenderImage::calcAspectRatioHeight):
        * rendering/RenderImage.h:
        (WebCore::RenderImage::isErrorImage):
        * rendering/RenderListItem.cpp:
        (WebCore::RenderListItem::setStyle):
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::isImage):

WebKit:

        Reviewed by .

        - reverting change to not cause regressions and performance problems.

        * Misc/WebNSAttributedStringExtras.mm:
        (fileWrapperForElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19590 268f45cc-cd09-0410-ab3c-d52691b4dbfc

27 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/loader/local-JavaScript-from-local-expected.txt [deleted file]
LayoutTests/fast/loader/local-JavaScript-from-local.html [deleted file]
LayoutTests/fast/loader/local-iFrame-source-from-local-expected.txt [deleted file]
LayoutTests/fast/loader/local-iFrame-source-from-local.html [deleted file]
LayoutTests/fast/loader/local-image-from-local-expected.txt [deleted file]
LayoutTests/fast/loader/local-image-from-local.html [deleted file]
WebCore/ChangeLog
WebCore/bindings/objc/DOM.mm
WebCore/dom/XMLTokenizer.cpp
WebCore/html/HTMLImageLoader.cpp
WebCore/html/HTMLTokenizer.cpp
WebCore/ksvg2/misc/SVGImageLoader.cpp
WebCore/loader/Cache.cpp
WebCore/loader/CachedImage.h
WebCore/loader/CachedResource.h
WebCore/loader/CachedScript.h
WebCore/loader/DocLoader.cpp
WebCore/loader/FrameLoader.cpp
WebCore/page/EventHandler.cpp
WebCore/rendering/HitTestResult.cpp
WebCore/rendering/RenderImage.cpp
WebCore/rendering/RenderImage.h
WebCore/rendering/RenderListItem.cpp
WebCore/rendering/RenderListMarker.cpp
WebKit/ChangeLog
WebKit/Misc/WebNSAttributedStringExtras.mm

index 6c594c988855b36e2c86582f9ba642dcb6fd9520..215b0041f9e38c5a806b1e44af853fe9130e7c57 100644 (file)
@@ -1,3 +1,16 @@
+2007-02-12  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by .
+
+        - reverting change to not cause regressions and performance problems.
+
+        * fast/loader/local-JavaScript-from-local-expected.txt: Removed.
+        * fast/loader/local-JavaScript-from-local.html: Removed.
+        * fast/loader/local-iFrame-source-from-local-expected.txt: Removed.
+        * fast/loader/local-iFrame-source-from-local.html: Removed.
+        * fast/loader/local-image-from-local-expected.txt: Removed.
+        * fast/loader/local-image-from-local.html: Removed.
+
 2007-02-12  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Dave Hyatt.
diff --git a/LayoutTests/fast/loader/local-JavaScript-from-local-expected.txt b/LayoutTests/fast/loader/local-JavaScript-from-local-expected.txt
deleted file mode 100644 (file)
index 5076d14..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-This test is to see if a local file can run a local script.
-
-Test Passed
-
diff --git a/LayoutTests/fast/loader/local-JavaScript-from-local.html b/LayoutTests/fast/loader/local-JavaScript-from-local.html
deleted file mode 100644 (file)
index 3ef0ee6..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<html>
-<head>
-        <script>
-            var secretness = 0;
-        </script>
-        <script src="file:///tmp/LayoutTests/http/tests/security/resources/localScript.js"/>
-        <script>
-            function test() {
-                if (window.layoutTestController)
-                    layoutTestController.dumpAsText();
-
-                    var tag = document.getElementById("result");
-                    if (secretness == 13)
-                        tag.innerHTML = "Test Passed";
-                    else
-                        tag.innerHTML = "Test Failed: Local script not run by local file.";
-            }
-        </script>
-</head>
-<body onload="test()">
-    <div id="div0">
-        This test is to see if a local file can run a local script.
-    </div>
-    </br>
-    <div id="result">
-        Test not run correctly.
-    </div>
-</body>
-</html>
diff --git a/LayoutTests/fast/loader/local-iFrame-source-from-local-expected.txt b/LayoutTests/fast/loader/local-iFrame-source-from-local-expected.txt
deleted file mode 100644 (file)
index 9080b41..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-This test is to see if a local file can include a local page in an iFrame.
-
-Test Passed.
-
diff --git a/LayoutTests/fast/loader/local-iFrame-source-from-local.html b/LayoutTests/fast/loader/local-iFrame-source-from-local.html
deleted file mode 100644 (file)
index ee359c1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<html>
-<head>
-    <script>
-        if (window.layoutTestController) {
-            layoutTestController.dumpAsText();
-        }
-    
-        function iFrameTest() {
-            if (window.layoutTestController)
-                layoutTestController.dumpAsText();
-
-            var result = document.getElementById("result");
-
-            var myFrameDocument = document.getElementById("myFrame").contentDocument;
-            if (myFrameDocument) {
-                result.innerHTML = "Test Passed.";
-            } else {
-                result.innerHTML = "Test Failed: Local page not locally loaded into iFrame.";
-            }
-        }
-    </script>
-</head>
-<body>
-    <div id="div0">
-        This test is to see if a local file can include a local page in an iFrame.
-    </div>
-    </br>
-    <div id="result">
-        Test not run correctly.
-    </div>
-    <iFrame id="myFrame" onload="iFrameTest()" src="file:///tmp/LayoutTests/http/tests/security/resources/localPage.html" />
-</body>
-</html>
diff --git a/LayoutTests/fast/loader/local-image-from-local-expected.txt b/LayoutTests/fast/loader/local-image-from-local-expected.txt
deleted file mode 100644 (file)
index 2864509..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-This test is to see if a local file can include a local image.
-
-Test Passed
-
-
diff --git a/LayoutTests/fast/loader/local-image-from-local.html b/LayoutTests/fast/loader/local-image-from-local.html
deleted file mode 100644 (file)
index 7162ce5..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<html>
-<head>
-    <script>        
-        function imgTest() {
-            if (window.layoutTestController)
-                layoutTestController.dumpAsText();
-            
-            var result = document.getElementById("result");
-            
-            var myImg = document.getElementById("myImg");
-            if (myImg.width > 0 && myImg.height > 0) {
-                result.innerHTML = "Test Passed";
-            } else {
-                result.innerHTML = "Test Failed: Image width or height <= 0";
-            }
-        }
-    </script>
-</head>
-<body onload="imgTest()">
-    <div id="div0">
-        This test is to see if a local file can include a local image.
-    </div>
-    </br>
-    <div id="result">
-        Test has not run.
-    </div>
-    </br>
-    <img id="myImg" src="file:///tmp/LayoutTests/http/tests/security/resources/compass.jpg" />
-</body>
-</html>
index 7c3dc6b9acad92d99ff5c29e8d184d9043950523..49ecb56f286086e7b830635df0bc8294e37254e7 100644 (file)
@@ -1,3 +1,53 @@
+2007-02-12  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by .
+
+        - reverting change to not cause regressions and performance problems.
+
+        * bindings/objc/DOM.mm:
+        (-[DOMElement image]):
+        (-[DOMElement _imageTIFFRepresentation]):
+        * dom/XMLTokenizer.cpp:
+        (WebCore::XMLTokenizer::notifyFinished):
+        * html/HTMLImageLoader.cpp:
+        (WebCore::HTMLImageLoader::dispatchLoadEvent):
+        * html/HTMLTokenizer.cpp:
+        (WebCore::HTMLTokenizer::reset):
+        (WebCore::HTMLTokenizer::notifyFinished):
+        * ksvg2/misc/SVGImageLoader.cpp:
+        (WebCore::SVGImageLoader::dispatchLoadEvent):
+        * loader/Cache.cpp:
+        (WebCore::Cache::requestResource):
+        (WebCore::Cache::remove):
+        * loader/CachedImage.h:
+        (WebCore::CachedImage::canRender):
+        (WebCore::CachedImage::isErrorImage):
+        * loader/CachedResource.h:
+        * loader/CachedScript.h:
+        (WebCore::CachedScript::errorOccurred):
+        * loader/DocLoader.cpp:
+        (WebCore::DocLoader::requestResource):
+        (WebCore::DocLoader::setLoadInProgress):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::canLoad):
+        * page/EventHandler.cpp:
+        (WebCore::selectCursor):
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::image):
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::setCachedImage):
+        (WebCore::RenderImage::imageChanged):
+        (WebCore::RenderImage::paint):
+        (WebCore::RenderImage::layout):
+        (WebCore::RenderImage::calcAspectRatioWidth):
+        (WebCore::RenderImage::calcAspectRatioHeight):
+        * rendering/RenderImage.h:
+        (WebCore::RenderImage::isErrorImage):
+        * rendering/RenderListItem.cpp:
+        (WebCore::RenderListItem::setStyle):
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::isImage):
+
 2007-02-12  Mitz Pettel  <mitz@webkit.org>
 
         Reviewed by Dave Hyatt.
index 8c6c46e12bd4aacc358503ac25f2c89a1245bdec..0d2b65b39d5f60e76cba5a10908c7c8ac8f3b935 100644 (file)
@@ -485,7 +485,7 @@ static NSArray *kit(const Vector<IntRect>& rects)
     WebCore::RenderObject* renderer = [self _element]->renderer();
     if (renderer && renderer->isImage()) {
         WebCore::RenderImage* img = static_cast<WebCore::RenderImage*>(renderer);
-        if (img->cachedImage() && !img->cachedImage()->errorOccurred())
+        if (img->cachedImage() && !img->cachedImage()->isErrorImage())
             return img->cachedImage()->image()->getNSImage();
     }
     return nil;
@@ -510,7 +510,7 @@ static NSArray *kit(const Vector<IntRect>& rects)
     WebCore::RenderObject* renderer = [self _element]->renderer();
     if (renderer && renderer->isImage()) {
         WebCore::RenderImage* img = static_cast<WebCore::RenderImage*>(renderer);
-        if (img->cachedImage() && !img->cachedImage()->errorOccurred())
+        if (img->cachedImage() && !img->cachedImage()->isErrorImage())
             return (NSData*)(img->cachedImage()->image()->getTIFFRepresentation());
     }
     return nil;
index ac7bea6aa8311712030add3998cf61248a2e2bf6..ca28c56216350ca5e7ac7c3618adef5fdfb5e399 100644 (file)
@@ -1261,6 +1261,7 @@ void XMLTokenizer::insertErrorMessageBlock()
 void XMLTokenizer::notifyFinished(CachedResource* finishedObj)
 {
     ASSERT(m_pendingScript == finishedObj);
+    ASSERT(m_pendingScript->accessCount() > 0);
         
     String cachedScriptUrl = m_pendingScript->url();
     String scriptSource = m_pendingScript->script();
index 122c3113f3215412958be8377851a6326555071d..301ea9d3eb75d58c6396ed4b7938dbba2f447e5d 100644 (file)
@@ -123,7 +123,7 @@ void HTMLImageLoader::dispatchLoadEvent()
 {
     if (!haveFiredLoadEvent() && image()) {
         setHaveFiredLoadEvent(true);
-        element()->dispatchHTMLEvent(image()->errorOccurred() ? errorEvent : loadEvent, false, false);
+        element()->dispatchHTMLEvent(image()->isErrorImage() ? errorEvent : loadEvent, false, false);
     }
 }
 
index 3e1ed757cb2f68ba829929666f9b28407ea5d68a..82d7071c81506fbe9ddae0ca10ea61dfff48232f 100644 (file)
@@ -196,6 +196,7 @@ void HTMLTokenizer::reset()
 
     while (!pendingScripts.isEmpty()) {
       CachedScript *cs = pendingScripts.dequeue();
+      ASSERT(cs->accessCount() > 0);
       cs->deref(this);
     }
     
@@ -1633,6 +1634,7 @@ void HTMLTokenizer::notifyFinished(CachedResource*)
         kdDebug( 6036 ) << "Finished loading an external script" << endl;
 #endif
         CachedScript* cs = pendingScripts.dequeue();
+        ASSERT(cs->accessCount() > 0);
 
         String scriptSource = cs->script();
 #ifdef TOKEN_DEBUG
index b15bb9a41b30b3add7b2b6ed348e438164b7ea6e..ff522eaa6ed63a310c051fca3f6dc75ab43d64f6 100644 (file)
@@ -70,7 +70,7 @@ void SVGImageLoader::dispatchLoadEvent()
 {
     if (!haveFiredLoadEvent() && image()) {
         setHaveFiredLoadEvent(true);
-        if (image()->errorOccurred()) {
+        if (image()->isErrorImage()) {
             // FIXME: We're supposed to put the document in an "error state" per the spec.
         } else
             static_cast<SVGElement*>(element())->sendSVGLoadEventIfPossible(true);
index 187184f2f78b8c80760cd77365337034aecbfced..0b8c2ecfe54cb53036ae04b04ad82df161082e9a 100644 (file)
@@ -91,8 +91,6 @@ CachedResource* Cache::requestResource(DocLoader* docLoader, CachedResource::Typ
         // The resource does not exist.  Create it.
         resource = createResource(type, docLoader, url, expireDate, charset);
         ASSERT(resource);
-        if (resource->errorOccurred())
-            return resource;
         resource->setInCache(!disabled());
         if (!disabled())
             m_resources.set(url.url(), resource);  // The size will be added in later once the resource is loaded and calls back to us with the new size.
@@ -162,6 +160,8 @@ void Cache::setMaximumSize(unsigned bytes)
 
 void Cache::remove(CachedResource* resource)
 {
+    ASSERT(resource->inCache());
+
     // Remove from the resource map.
     m_resources.remove(resource->url());
     resource->setInCache(false);
index 07e5363aa8987c52cb13d6c274dfec4b255bd790..80bcc621c5c7c1f219d1278bd3439f9fcb5fbf99 100644 (file)
@@ -47,7 +47,7 @@ public:
 
     Image* image() const;
 
-    bool canRender() const { return !errorOccurred() && imageSize().width() > 0 && imageSize().height() > 0; }
+    bool canRender() const { return !isErrorImage() && imageSize().width() > 0 && imageSize().height() > 0; }
 
     IntSize imageSize() const;  // returns the size of the complete image
     IntRect imageRect() const;  // The size of the image.
@@ -58,6 +58,8 @@ public:
     virtual void data(Vector<char>&, bool allDataReceived);
     virtual void error();
 
+    bool isErrorImage() const { return m_errorOccurred; }
+
     virtual bool schedule() const { return true; }
 
     void checkNotify();
@@ -78,6 +80,8 @@ private:
 
     Image* m_image;
     int m_dataSize;
+    
+    bool m_errorOccurred : 1;
 
     friend class Cache;
 };
index 5f3f4042e0f8f2e80ea0c6f8e0e9f06ffeffd49a..e6ebadaa989d1c5068bb2ea1d09dbd1a8089eaf4 100644 (file)
@@ -75,8 +75,6 @@ public:
     virtual void data(Vector<char>&, bool allDataReceived) = 0;
     virtual void error() = 0;
 
-    bool errorOccurred() const { return m_errorOccurred; }
-
     const String &url() const { return m_url; }
     Type type() const { return m_type; }
 
@@ -144,7 +142,6 @@ protected:
     Type m_type;
     Status m_status;
 
-    bool m_errorOccurred;
 private:
     unsigned m_size;
     unsigned m_accessCount;
index f8b7f7fd85ae96b6bef981232110424b10e1e6f3..4f7f7900fa0aaf623d0d2257a1604c6d342b3c97 100644 (file)
@@ -49,12 +49,15 @@ namespace WebCore {
         virtual void error();
 
         virtual bool schedule() const { return false; }
+        
+        bool errorOccurred() const { return m_errorOccurred; }
 
         void checkNotify();
 
     private:
         String m_script;
         TextEncoding m_encoding;
+        bool m_errorOccurred;
     };
 }
 
index d2c5fcf557a4b43eae6a05608596844014ab342b..893f93b79833452a994a048ba4e0958cc656131c 100644 (file)
@@ -126,28 +126,16 @@ CachedResource* DocLoader::requestResource(CachedResource::Type type, const Stri
 {
     KURL fullURL = m_doc->completeURL(url.deprecatedString());
 
-    FrameLoader* fl = 0;
-    CachedResource* resource = 0;
-    if (m_frame)
-        fl = m_frame->loader();
-    if (!fl)
-        return resource;
-
-    if (fl->isReloading())
+    if (m_frame && m_frame->loader()->isReloading())
         setCachePolicy(CachePolicyReload);
 
     checkForReload(fullURL);
 
-    static bool hideReferrer;
-    //If you are not allowed to load you may not get from the cache either.
-    if (fl->canLoad(fullURL, fl->outgoingReferrer(), hideReferrer)) {
-        resource = cache()->requestResource(this, type, fullURL, m_expireDate, charset);
-        if (resource) {
-            m_docResources.set(resource->url(), resource);
-            checkCacheObjectStatus(resource);
-        }
+    CachedResource* resource = cache()->requestResource(this, type, fullURL, m_expireDate, charset);
+    if (resource) {
+        m_docResources.set(resource->url(), resource);
+        checkCacheObjectStatus(resource);
     }
-
     return resource;
 }
 
@@ -188,8 +176,6 @@ void DocLoader::removeCachedResource(CachedResource* resource) const
 
 void DocLoader::setLoadInProgress(bool load)
 {
-    ASSERT(m_frame);
-
     m_loadInProgress = load;
     if (!load)
         m_frame->loader()->loadDone();
index 58efe020f520893958f1bb1f7ed512dc0cedf530..c0a0ff0862ed3eea1a14ad896dc18b29149e27e3 100644 (file)
@@ -1894,11 +1894,11 @@ void FrameLoader::load(DocumentLoader* loader, FrameLoadType type, PassRefPtr<Fo
 
 bool FrameLoader::canLoad(const KURL& url, const String& referrer, bool& hideReferrer)
 {
-    bool referrerIsSecureURL = referrer.startsWith("https:", false);
-    bool referrerIsWebURL = referrerIsSecureURL || referrer.startsWith("http:", false);
+    bool referrerIsWebURL = referrer.startsWith("http:", false) || referrer.startsWith("https:", false);
     bool referrerIsLocalURL = referrer.startsWith("file:", false) || referrer.startsWith("applewebdata:");
     bool URLIsFileURL = url.protocol().startsWith("file", false);
-    bool URLIsSecureURL = url.protocol().startsWith("https", false);    
+    bool referrerIsSecureURL = referrer.startsWith("https:", false);
+    bool URLIsSecureURL = url.protocol().startsWith("https", false);
     
     hideReferrer = !referrerIsWebURL || (referrerIsSecureURL && !URLIsSecureURL);
     return !URLIsFileURL || referrerIsLocalURL;
index 4154ef947b7328cf5f430e84756918c80b341ebd..dc70d9889dad4396dea558b24749d5eba2560a4a 100644 (file)
@@ -643,7 +643,7 @@ static Cursor selectCursor(const MouseEventWithHitTestResults& event, Frame* fra
                 continue;
             if (cimage->image()->isNull())
                 break;
-            if (!cimage->errorOccurred()) {
+            if (!cimage->isErrorImage()) {
                 return Cursor(cimage->image(), hotSpot);
 }
         }
index ffc5dd20d93f70ba922d0b110e580cf6b76b130b..e9270e6cffa0870fa9687c387acc3d125113482b 100644 (file)
@@ -197,7 +197,7 @@ Image* HitTestResult::image() const
     RenderObject* renderer = m_innerNonSharedNode->renderer();
     if (renderer && renderer->isImage()) {
         RenderImage* image = static_cast<WebCore::RenderImage*>(renderer);
-        if (image->cachedImage() && !image->cachedImage()->errorOccurred())
+        if (image->cachedImage() && !image->cachedImage()->isErrorImage())
             return image->cachedImage()->image();
     }
 
index 6c9009c98cc740cb77639362817b3fbe9b2f1eee..05da6721cf09fe1b79bfb34cb1cce3fe9e6e51b4 100644 (file)
@@ -70,7 +70,7 @@ void RenderImage::setCachedImage(CachedImage* newImage)
     m_cachedImage = newImage;
     if (m_cachedImage) {
         m_cachedImage->ref(this);
-        if (m_cachedImage->errorOccurred())
+        if (m_cachedImage->isErrorImage())
             imageChanged(m_cachedImage);
     }
 }
@@ -136,14 +136,14 @@ void RenderImage::imageChanged(CachedImage* newImage)
     bool imageSizeChanged = false;
 
     // Set image dimensions, taking into account the size of the alt text.
-    if (newImage->errorOccurred())
+    if (newImage->isErrorImage())
         imageSizeChanged = setImageSizeForAltText(newImage);
     
     bool ensureLayout = false;
 
     // Image dimensions have been changed, see what needs to be done
     if (newImage->imageSize().width() != intrinsicWidth() || newImage->imageSize().height() != intrinsicHeight() || imageSizeChanged) {
-        if (!newImage->errorOccurred()) {
+        if (!newImage->isErrorImage()) {
             setIntrinsicWidth(newImage->imageSize().width());
             setIntrinsicHeight(newImage->imageSize().height());
         }
@@ -226,12 +226,12 @@ void RenderImage::paint(PaintInfo& paintInfo, int tx, int ty)
     if (isPrinting && !view()->printImages())
         return;
 
-    if (!m_cachedImage || image()->isNull() || errorOccurred()) {
+    if (!m_cachedImage || image()->isNull() || isErrorImage()) {
         if (paintInfo.phase == PaintPhaseSelection)
             return;
 
         if (cWidth > 2 && cHeight > 2) {
-            if (!errorOccurred()) {
+            if (!isErrorImage()) {
                 context->setStrokeStyle(SolidStroke);
                 context->setStrokeColor(Color::lightGray);
                 context->setFillColor(Color::transparent);
@@ -244,7 +244,7 @@ void RenderImage::paint(PaintInfo& paintInfo, int tx, int ty)
             int usableWidth = cWidth;
             int usableHeight = cHeight;
 
-            if (errorOccurred() && !image()->isNull() && (usableWidth >= image()->width()) && (usableHeight >= image()->height())) {
+            if (isErrorImage() && !image()->isNull() && (usableWidth >= image()->width()) && (usableHeight >= image()->height())) {
                 // Center the error image, accounting for border and padding.
                 int centerX = (usableWidth - image()->width()) / 2;
                 if (centerX < 0)
@@ -310,7 +310,7 @@ void RenderImage::layout()
     }
 
     // minimum height
-    m_height = m_cachedImage && m_cachedImage->errorOccurred() ? intrinsicHeight() : 0;
+    m_height = m_cachedImage && m_cachedImage->isErrorImage() ? intrinsicHeight() : 0;
 
     calcWidth();
     calcHeight();
@@ -415,7 +415,7 @@ int RenderImage::calcAspectRatioWidth() const
 {
     if (!intrinsicHeight())
         return 0;
-    if (!m_cachedImage || m_cachedImage->errorOccurred())
+    if (!m_cachedImage || m_cachedImage->isErrorImage())
         return intrinsicWidth(); // Don't bother scaling.
     return RenderReplaced::calcReplacedHeight() * intrinsicWidth() / intrinsicHeight();
 }
@@ -424,7 +424,7 @@ int RenderImage::calcAspectRatioHeight() const
 {
     if (!intrinsicWidth())
         return 0;
-    if (!m_cachedImage || m_cachedImage->errorOccurred())
+    if (!m_cachedImage || m_cachedImage->isErrorImage())
         return intrinsicHeight(); // Don't bother scaling.
     return RenderReplaced::calcReplacedWidth() * intrinsicHeight() / intrinsicWidth();
 }
index d886cf01f1ade0458ede8ada0af631d927ccc133..eda221ece853bd1ff3e7a633caca884d51add60e 100644 (file)
@@ -78,7 +78,7 @@ private:
     bool isWidthSpecified() const;
     bool isHeightSpecified() const;
 
-    bool errorOccurred() const { return m_cachedImage && m_cachedImage->errorOccurred(); }
+    bool isErrorImage() const { return m_cachedImage && m_cachedImage->isErrorImage(); }
 
     // The image we are rendering.
     CachedImage* m_cachedImage;
index 2d5d0e2242dc2cfcf64bb8c2137d10521d60d3fb..35781c34114faff4c80abb5e4cecb891eb867a02 100644 (file)
@@ -52,7 +52,7 @@ void RenderListItem::setStyle(RenderStyle* newStyle)
     RenderBlock::setStyle(newStyle);
 
     if (style()->listStyleType() != LNONE ||
-        (style()->listStyleImage() && !style()->listStyleImage()->errorOccurred())) {
+        (style()->listStyleImage() && !style()->listStyleImage()->isErrorImage())) {
         RenderStyle* newStyle = new (renderArena()) RenderStyle;
         newStyle->ref();
         // The marker always inherits from the list item, regardless of where it might end
index 4b05765984ca8e4a3b32ef74f1f307f1a19ba5ea..68e807b4aa6054004a6690a3e5cddaf6c9dbac73 100644 (file)
@@ -506,7 +506,7 @@ InlineBox* RenderListMarker::createInlineBox(bool, bool isRootLineBox, bool)
 
 bool RenderListMarker::isImage() const
 {
-    return m_image && !m_image->errorOccurred();
+    return m_image && !m_image->isErrorImage();
 }
 
 void RenderListMarker::paint(PaintInfo& paintInfo, int tx, int ty)
index 8232eaa4b26e0469d9fd30d390ee87717a8e05e2..3dbc76ba606c89f12b23d14a2dd8c9c6fc692ed7 100644 (file)
@@ -1,3 +1,12 @@
+2007-02-12  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by .
+
+        - reverting change to not cause regressions and performance problems.
+
+        * Misc/WebNSAttributedStringExtras.mm:
+        (fileWrapperForElement):
+
 2007-02-12  Darin Adler  <darin@apple.com>
 
         Reviewed by Oliver.
         (-[WebView undoManager]):
         * WebView/WebViewPrivate.h:
 
->>>>>>> .r19243
 2007-01-29  Ada Chan  <adachan@apple.com>
 
         Reviewed by Brady.
index 0539c67f203811699d66b85584dd5e7186e3469e..6d82024cb9fb5d19f6bb11892bc9063c402493a1 100644 (file)
@@ -98,7 +98,7 @@ static NSFileWrapper *fileWrapperForElement(Element* e)
     }
     if (!wrapper) {
         RenderImage* renderer = static_cast<RenderImage*>(e->renderer());
-        if (renderer->cachedImage() && !renderer->cachedImage()->errorOccurred()) {
+        if (renderer->cachedImage() && !renderer->cachedImage()->isErrorImage()) {
             wrapper = [[NSFileWrapper alloc] initRegularFileWithContents:(NSData *)(renderer->cachedImage()->image()->getTIFFRepresentation())];
             [wrapper setPreferredFilename:@"image.tiff"];
             [wrapper autorelease];