[webkit-reviews] review granted: [Bug 41305] [Chromium] Characters with bidi-mirror property are not correctly mirrored in Linux : [Attachment 60804] patch w/ layout test

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 7 16:56:59 PDT 2010


David Levin <levin at chromium.org> has granted Xiaomei Ji <xji at chromium.org>'s
request for review:
Bug 41305: [Chromium] Characters with bidi-mirror property are not correctly
mirrored in Linux
https://bugs.webkit.org/show_bug.cgi?id=41305

Attachment 60804: patch w/ layout test
https://bugs.webkit.org/attachment.cgi?id=60804&action=review

------- Additional Comments from David Levin <levin at chromium.org>

> Index: WebCore/platform/graphics/chromium/FontLinux.cpp
> +	   m_item.stringLength = length;
> +
> +	   if (!m_item.item.bidiLevel)
> +	       m_item.string = m_run.characters();
> +	   else {
> +	       // Assume mirrored character is in the same BMP as the original
one.

Please expand "BMP" to "basic multilingual plane" (as you told me that it stood
for).

> +	       UChar* string = new UChar[length];
> +	       mirrorCharacters(string, m_run.characters(), length);
> +	       m_item.string = string;
> +	   }
> +
>	   reset();
>      }
>  
> @@ -192,6 +203,8 @@ public:
>	   fastFree(m_item.font);
>	   deleteGlyphArrays();
>	   delete[] m_item.log_clusters;
> +	   if (m_item.item.bidiLevel)
> +	       delete[] m_item.string;
>      }
>  
>      void reset()
> @@ -455,6 +468,22 @@ private:
>	   m_offsetX += m_pixelWidth;
>      }
>  
> +    void mirrorCharacters(UChar* dst, const UChar* src, int length) const
> +    {
> +	   int position = 0;
> +	   bool error;
> +	   // Iterate characters in src and mirror character if needed.
> +	   while (position < length) {
> +	     UChar32 character;

Need a 4 space indent.


More information about the webkit-reviews mailing list