[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:21:22 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 333300daddcb4ded3872c0bb7872ac270779a944
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 23 17:33:58 2003 +0000

            Reviewed by Dave.
    
    	- fixed 3154575 -- REGRESSION: Right sidebar on Yahoo! page in base PLT renders incorrectly
    
            * khtml/rendering/break_lines.cpp: (isBreakable): Pass kUCTextBreakLineMask to the
    	UC calls, which looks for places where line breaks are allowed, instead of kUCTextBreakWordMask,
    	which finds all word breaks instead. We still pass all the layout tests, so I think this means
    	Japanese word breaking is still OK.
    
    	- fixed 3154416 -- images that specify width but not height should keep aspect ratio (example at thegods.org.uk)
    
            * khtml/rendering/render_image.h: Declared new member functions.
            * khtml/rendering/render_image.cpp:
            (RenderImage::widthSpecified): Added helper function.
            (RenderImage::heightSpecified): Added helper function.
            (RenderImage::calcReplacedWidth): Added. Derives width from height keeping aspect ratio if we
    	have a specified height and no width.
            (RenderImage::calcReplacedHeight): Added. Same thing in the opposite direction.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3417 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 810d6bd..b05dd2b 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,24 @@
+2003-01-23  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
+	- fixed 3154575 -- REGRESSION: Right sidebar on Yahoo! page in base PLT renders incorrectly
+
+        * khtml/rendering/break_lines.cpp: (isBreakable): Pass kUCTextBreakLineMask to the
+	UC calls, which looks for places where line breaks are allowed, instead of kUCTextBreakWordMask,
+	which finds all word breaks instead. We still pass all the layout tests, so I think this means
+	Japanese word breaking is still OK.
+
+	- fixed 3154416 -- images that specify width but not height should keep aspect ratio (example at thegods.org.uk)
+
+        * khtml/rendering/render_image.h: Declared new member functions.
+        * khtml/rendering/render_image.cpp:
+        (RenderImage::widthSpecified): Added helper function.
+        (RenderImage::heightSpecified): Added helper function.
+        (RenderImage::calcReplacedWidth): Added. Derives width from height keeping aspect ratio if we
+	have a specified height and no width.
+        (RenderImage::calcReplacedHeight): Added. Same thing in the opposite direction.
+
 2003-01-22  Trey Matteson  <trey at apple.com>
 
 	3153313 cursor changes during text selection when we cross links
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 810d6bd..b05dd2b 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,24 @@
+2003-01-23  Darin Adler  <darin at apple.com>
+
+        Reviewed by Dave.
+
+	- fixed 3154575 -- REGRESSION: Right sidebar on Yahoo! page in base PLT renders incorrectly
+
+        * khtml/rendering/break_lines.cpp: (isBreakable): Pass kUCTextBreakLineMask to the
+	UC calls, which looks for places where line breaks are allowed, instead of kUCTextBreakWordMask,
+	which finds all word breaks instead. We still pass all the layout tests, so I think this means
+	Japanese word breaking is still OK.
+
+	- fixed 3154416 -- images that specify width but not height should keep aspect ratio (example at thegods.org.uk)
+
+        * khtml/rendering/render_image.h: Declared new member functions.
+        * khtml/rendering/render_image.cpp:
+        (RenderImage::widthSpecified): Added helper function.
+        (RenderImage::heightSpecified): Added helper function.
+        (RenderImage::calcReplacedWidth): Added. Derives width from height keeping aspect ratio if we
+	have a specified height and no width.
+        (RenderImage::calcReplacedHeight): Added. Same thing in the opposite direction.
+
 2003-01-22  Trey Matteson  <trey at apple.com>
 
 	3153313 cursor changes during text selection when we cross links
diff --git a/WebCore/khtml/rendering/break_lines.cpp b/WebCore/khtml/rendering/break_lines.cpp
index 46f56fb..2a77da7 100644
--- a/WebCore/khtml/rendering/break_lines.cpp
+++ b/WebCore/khtml/rendering/break_lines.cpp
@@ -89,9 +89,9 @@ bool isBreakable( const QChar *s, int pos, int len)
     unsigned short ch = c->unicode();
     
     if (ch > 0x7f){
-        status = UCCreateTextBreakLocator (NULL, 0, kUCTextBreakWordMask, &breakLocator);
+        status = UCCreateTextBreakLocator (NULL, 0, kUCTextBreakLineMask, &breakLocator);
         if (status == 0){
-            findStatus = UCFindTextBreak (breakLocator,  kUCTextBreakWordMask, NULL, (const UniChar *)s, (UniCharCount)len, (UniCharArrayOffset)pos, (UniCharArrayOffset *)&end);
+            findStatus = UCFindTextBreak (breakLocator, kUCTextBreakLineMask, NULL, (const UniChar *)s, len, pos, &end);
         }
         // If carbon fails, fail back on simple white space detection.
         if (findStatus == 0)
diff --git a/WebCore/khtml/rendering/render_image.cpp b/WebCore/khtml/rendering/render_image.cpp
index 0177af3..954e809 100644
--- a/WebCore/khtml/rendering/render_image.cpp
+++ b/WebCore/khtml/rendering/render_image.cpp
@@ -400,3 +400,51 @@ void RenderImage::updateFromElement()
     else if (element()->id() == ID_IMG)
         alt = static_cast<HTMLImageElementImpl*>(element())->altText();
 }
+
+bool RenderImage::isWidthSpecified() const
+{
+    switch (style()->width().type) {
+        case Fixed:
+        case Percent:
+            return true;
+        case Variable:
+        case Relative:
+        case Static:
+            return false;
+    }
+    assert(false);
+    return false;
+}
+
+bool RenderImage::isHeightSpecified() const
+{
+    switch (style()->height().type) {
+        case Fixed:
+        case Percent:
+            return true;
+        case Variable:
+        case Relative:
+        case Static:
+            return false;
+    }
+    assert(false);
+    return false;
+}
+
+short RenderImage::calcReplacedWidth() const
+{
+    // If height is specified and not width, preserve aspect ratio.
+    if (isHeightSpecified() && !isWidthSpecified()) {
+        return calcReplacedHeight() * intrinsicWidth() / intrinsicHeight();
+    }
+    return RenderReplaced::calcReplacedWidth();
+}
+
+int RenderImage::calcReplacedHeight() const
+{
+    // If width is specified and not height, preserve aspect ratio.
+    if (isWidthSpecified() && !isHeightSpecified()) {
+        return calcReplacedWidth() * intrinsicHeight() / intrinsicWidth();
+    }
+    return RenderReplaced::calcReplacedHeight();
+}
diff --git a/WebCore/khtml/rendering/render_image.h b/WebCore/khtml/rendering/render_image.h
index 40cf79e..d28f6b0 100644
--- a/WebCore/khtml/rendering/render_image.h
+++ b/WebCore/khtml/rendering/render_image.h
@@ -65,8 +65,14 @@ public:
     virtual void notifyFinished(CachedObject *finishedObj);
 
     virtual bool nodeAtPoint(NodeInfo& info, int x, int y, int tx, int ty, bool inside=false);
+    
+    virtual short calcReplacedWidth() const;
+    virtual int calcReplacedHeight() const;
 
 private:
+    bool isWidthSpecified() const;
+    bool isHeightSpecified() const;
+
     /*
      * Pointer to the image
      * If this pointer is 0L, that means that the picture could not be loaded

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list