[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

hyatt at apple.com hyatt at apple.com
Wed Dec 22 15:57:10 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c8f310c088b75300148210543e63c45e952fb133
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 17 03:24:39 2010 +0000

    Add FontBaseline.h and make ascent and descent take a baseline parameter so that both an
    alphabetic and ideographic baseline can be requested.
    
    Reviewed by Sam Weinig.
    
    * WebCore.xcodeproj/project.pbxproj:
    * platform/graphics/Font.h:
    (WebCore::Font::ascent):
    (WebCore::Font::descent):
    * platform/graphics/FontBaseline.h: Added.
    * platform/graphics/SimpleFontData.h:
    (WebCore::SimpleFontData::ascent):
    (WebCore::SimpleFontData::descent):
    (WebCore::SimpleFontData::height):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72165 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2e93b93..d9804d8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-11-16  Dave Hyatt  <hyatt at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Add FontBaseline.h and make ascent and descent take a baseline parameter so that both an
+        alphabetic and ideographic baseline can be requested.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/Font.h:
+        (WebCore::Font::ascent):
+        (WebCore::Font::descent):
+        * platform/graphics/FontBaseline.h: Added.
+        * platform/graphics/SimpleFontData.h:
+        (WebCore::SimpleFontData::ascent):
+        (WebCore::SimpleFontData::descent):
+        (WebCore::SimpleFontData::height):
+
 2010-11-16  Antti Koivisto  <koivisto at iki.fi>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 792d5e5..aed1579 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -5056,6 +5056,7 @@
 		BCB773610C17853D00132BA4 /* JSNodeFilterCondition.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB7735E0C17853D00132BA4 /* JSNodeFilterCondition.cpp */; };
 		BCB773620C17853D00132BA4 /* JSNodeFilterCondition.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB7735F0C17853D00132BA4 /* JSNodeFilterCondition.h */; };
 		BCB773630C17853D00132BA4 /* JSNodeFilterCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCB773600C17853D00132BA4 /* JSNodeFilterCustom.cpp */; };
+		BCB92D4F1293550B00C8387F /* FontBaseline.h in Headers */ = {isa = PBXBuildFile; fileRef = BCB92D4E1293550B00C8387F /* FontBaseline.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		BCBCAE370FF19385000762AE /* DataGridDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBCAE360FF19385000762AE /* DataGridDataSource.h */; };
 		BCBCAE3C0FF19399000762AE /* JSDataGridDataSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCBCAE3A0FF19399000762AE /* JSDataGridDataSource.cpp */; };
 		BCBCAE3D0FF19399000762AE /* JSDataGridDataSource.h in Headers */ = {isa = PBXBuildFile; fileRef = BCBCAE3B0FF19399000762AE /* JSDataGridDataSource.h */; };
@@ -11090,6 +11091,7 @@
 		BCB7735E0C17853D00132BA4 /* JSNodeFilterCondition.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeFilterCondition.cpp; sourceTree = "<group>"; };
 		BCB7735F0C17853D00132BA4 /* JSNodeFilterCondition.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSNodeFilterCondition.h; sourceTree = "<group>"; };
 		BCB773600C17853D00132BA4 /* JSNodeFilterCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSNodeFilterCustom.cpp; sourceTree = "<group>"; };
+		BCB92D4E1293550B00C8387F /* FontBaseline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontBaseline.h; sourceTree = "<group>"; };
 		BCBCAE360FF19385000762AE /* DataGridDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DataGridDataSource.h; sourceTree = "<group>"; };
 		BCBCAE3A0FF19399000762AE /* JSDataGridDataSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDataGridDataSource.cpp; sourceTree = "<group>"; };
 		BCBCAE3B0FF19399000762AE /* JSDataGridDataSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDataGridDataSource.h; sourceTree = "<group>"; };
@@ -16683,6 +16685,7 @@
 				B2C3DA580D006CD600EF6F26 /* FontFamily.cpp */,
 				B2C3DA590D006CD600EF6F26 /* FontFamily.h */,
 				72626E010EF022FE00A07E20 /* FontFastPath.cpp */,
+				BCB92D4E1293550B00C8387F /* FontBaseline.h */,
 				F7A034C3126BF6BE007DC19E /* FontOrientation.h */,
 				37ACCE410DA2980F0089E602 /* FontRenderingMode.h */,
 				B2C3DA5A0D006CD600EF6F26 /* FontSelector.h */,
@@ -21326,6 +21329,7 @@
 				499B3C59128C641E00E726C2 /* GraphicsLayerMac.h in Headers */,
 				08250939128BD4D800E2ED8E /* SVGAnimatedTransformList.h in Headers */,
 				3888F6EF128C9889000CA8E0 /* InspectorFileSystemAgent.h in Headers */,
+				BCB92D4F1293550B00C8387F /* FontBaseline.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebCore/platform/graphics/Font.h b/WebCore/platform/graphics/Font.h
index 73c955e..cb83ad2 100644
--- a/WebCore/platform/graphics/Font.h
+++ b/WebCore/platform/graphics/Font.h
@@ -127,8 +127,8 @@ public:
     bool isPlatformFont() const { return m_isPlatformFont; }
 
     // Metrics that we query the FontFallbackList for.
-    int ascent() const { return primaryFont()->ascent(); }
-    int descent() const { return primaryFont()->descent(); }
+    int ascent(FontBaseline baselineType = AlphabeticBaseline) const { return primaryFont()->ascent(baselineType); }
+    int descent(FontBaseline baselineType = AlphabeticBaseline) const { return primaryFont()->descent(baselineType); }
     int height() const { return ascent() + descent(); }
     int lineSpacing() const { return primaryFont()->lineSpacing(); }
     int lineGap() const { return primaryFont()->lineGap(); }
diff --git a/WebCore/platform/graphics/FontBaseline.h b/WebCore/platform/graphics/FontBaseline.h
new file mode 100644
index 0000000..f7d256d
--- /dev/null
+++ b/WebCore/platform/graphics/FontBaseline.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef FontBaseline_h
+#define FontBaseline_h
+
+namespace WebCore {
+
+enum FontBaseline { AlphabeticBaseline, IdeographicBaseline };
+
+} // namespace WebCore
+
+#endif // FontBaseline_h
diff --git a/WebCore/platform/graphics/SimpleFontData.h b/WebCore/platform/graphics/SimpleFontData.h
index 24e2c4c..8ff8ead 100644
--- a/WebCore/platform/graphics/SimpleFontData.h
+++ b/WebCore/platform/graphics/SimpleFontData.h
@@ -24,6 +24,7 @@
 #ifndef SimpleFontData_h
 #define SimpleFontData_h
 
+#include "FontBaseline.h"
 #include "FontData.h"
 #include "FontPlatformData.h"
 #include "FloatRect.h"
@@ -80,8 +81,9 @@ public:
     SimpleFontData* brokenIdeographFontData() const;
     
     // vertical metrics
-    int ascent() const { return m_ascent; }
-    int descent() const { return m_descent; }
+    int ascent(FontBaseline baselineType = AlphabeticBaseline) const { return baselineType == AlphabeticBaseline ? m_ascent : height() - height() / 2; }
+    int descent(FontBaseline baselineType = AlphabeticBaseline) const { return baselineType == AlphabeticBaseline ? m_descent : height() / 2; }
+    int height() const { return m_ascent + m_descent; }
     int lineSpacing() const { return m_lineSpacing; }
     int lineGap() const { return m_lineGap; }
     float maxCharWidth() const { return m_maxCharWidth; }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list