WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch: implementation of minimal HTML5 ruby support
ruby.patch (text/plain), 91.79 KB, created by
Roland Steiner
on 2009-07-13 02:52:47 PDT
(
hide
)
Description:
patch: implementation of minimal HTML5 ruby support
Filename:
MIME Type:
Creator:
Roland Steiner
Created:
2009-07-13 02:52:47 PDT
Size:
91.79 KB
patch
obsolete
>Index: ChangeLog >=================================================================== >--- ChangeLog (revision 45795) >+++ ChangeLog (working copy) >@@ -1,3 +1,11 @@ >+2009-07-13 Roland Steiner <rolandsteiner@google.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added flag ENABLE_RUBY to enable/disable HTML5 ruby support. >+ >+ * configure.ac: Added flag ENABLE_RUBY. >+ > 2009-07-13 Drew Wilson <atwilson@google.com> > > Reviewed by David Levin. >Index: configure.ac >=================================================================== >--- configure.ac (revision 45782) >+++ configure.ac (working copy) >@@ -353,6 +353,14 @@ AC_ARG_ENABLE(icon_database, > [],[enable_icon_database="yes"]) > AC_MSG_RESULT([$enable_icon_database]) > >+# check whether to enable HTML5 ruby support >+AC_MSG_CHECKING([whether to enable HTML5 ruby support]) >+AC_ARG_ENABLE(ruby, >+ AC_HELP_STRING([--enable-ruby], >+ [enable HTML5 ruby support [default=yes]]), >+ [],[enable_ruby="yes"]) >+AC_MSG_RESULT([$enable_ruby]) >+ > # check whether to enable HTML5 audio/video support > AC_MSG_CHECKING([whether to enable HTML5 video support]) > AC_ARG_ENABLE(video, >@@ -680,6 +688,7 @@ AM_CONDITIONAL([ENABLE_XPATH],[test "$en > AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"]) > AM_CONDITIONAL([ENABLE_FILTERS],[test "$enable_filters" = "yes"]) > AM_CONDITIONAL([ENABLE_GEOLOCATION], [test "$enable_geolocation" = "yes"]) >+AM_CONDITIONAL([ENABLE_RUBY],[test "$enable_ruby" = "yes"]) > AM_CONDITIONAL([ENABLE_VIDEO],[test "$enable_video" = "yes"]) > AM_CONDITIONAL([ENABLE_SVG],[test "$enable_svg" = "yes"]) > AM_CONDITIONAL([ENABLE_SVG_ANIMATION],[test "$enable_svg_animation" = "yes"]) >@@ -727,6 +736,7 @@ Features: > HTML5 channel messaging support : $enable_channel_messaging > HTML5 client-side session and persistent storage support : $enable_dom_storage > HTML5 client-side database storage support : $enable_database >+ HTML5 ruby support : $enable_ruby > HTML5 video element support : $enable_video > Icon database support : $enable_icon_database > SVG support : $enable_svg >Index: JavaScriptCore/ChangeLog >=================================================================== >--- JavaScriptCore/ChangeLog (revision 45795) >+++ JavaScriptCore/ChangeLog (working copy) >@@ -1,3 +1,11 @@ >+2009-07-13 Roland Steiner <rolandsteiner@google.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added flag ENABLE_RUBY to enable/disable HTML5 ruby support. >+ >+ * Configurations/FeatureDefines.xcconfig: Added flag ENABLE_RUBY. >+ > 2009-07-13 Drew Wilson <atwilson@google.com> > > Reviewed by David Levin. >Index: JavaScriptCore/Configurations/FeatureDefines.xcconfig >=================================================================== >--- JavaScriptCore/Configurations/FeatureDefines.xcconfig (revision 45782) >+++ JavaScriptCore/Configurations/FeatureDefines.xcconfig (working copy) >@@ -39,6 +39,7 @@ ENABLE_GEOLOCATION = ; > ENABLE_ICONDATABASE = ENABLE_ICONDATABASE; > ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER; > ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS; >+ENABLE_RUBY = ENABLE_RUBY; > ENABLE_SVG = ENABLE_SVG; > ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION; > ENABLE_SVG_AS_IMAGE = ENABLE_SVG_AS_IMAGE; >@@ -52,4 +53,4 @@ ENABLE_WORKERS = ENABLE_WORKERS; > ENABLE_XPATH = ENABLE_XPATH; > ENABLE_XSLT = ENABLE_XSLT; > >-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DOM_STORAGE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT); >+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DOM_STORAGE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT); >Index: WebCore/ChangeLog >=================================================================== >--- WebCore/ChangeLog (revision 45795) >+++ WebCore/ChangeLog (working copy) >@@ -1,3 +1,159 @@ >+2009-07-13 Roland Steiner <rolandsteiner@google.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Implemented basic HTML5 ruby support. >+ (see http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-ruby-element) >+ >+ No CSS3 ruby properties or values are honored. >+ The CSS3 box model is honored in a rudimentary way >+ (borders and padding surround the whole <ruby> element>. >+ >+ Ruby is rendered if a <ruby> HTML tag is encountered. >+ CSS3 display values ('ruby', 'ruby-base', etc.) are not used. >+ The normal box model is as follows (with their display analogy in brackets): >+ >+ RenderRubyAsInline*) (inline)/RenderRubyAsBlock*) (block) >+ 1+ RenderRubyRun (inline-block) >+ 1 RenderRubyBase(block) >+ 1+ text and/or inline objects >+ 0-2**) RenderRubyText(block) >+ 1+ text and/or inline objects >+ >+ Other objects are wrapped as necessary in order to preserve this tree structure. >+ >+ *) ruby is normally an inline objects, and thus will be represented by RenderRubyAsInline. >+ However, when the ruby element itself is floated or positioned, RenderRubyAsBlock will be used. >+ >+ **)A 2nd <rt> for a given base currently is allowed and will render below the base. >+ Note that this isn't tested for in the layout tests, as this feature may be controversial. >+ >+ The main logic is contained in RenderRubyRun and RubyInlineFlowBox. >+ >+ RenderRubyAsInline/RenderRubyAsBlock are rather simple sub-classes that mainly do special child handling. >+ RenderRubyRun subclasses and re-uses the functionality of RenderBlock for layouting. >+ RenderRubyBase and RenderRubyText are simple subclasses of RenderBlock that only do special child handling. >+ RubyInlineFlowBox is a subclass of InlineFLowBox and does the border and padding handling >+ for the whole <ruby> element and its contents. >+ RoubyRootInlineBox is a similar subclass to RootInlineBox, but as its used only in block >+ layouting, it only needs to override a single information method isRuby(). >+ >+ To limit the size of the patch, tests are contained in a separate patch file. >+ >+ Tests: fast/ruby/ruby-length-border.html >+ fast/ruby/ruby-length.html >+ fast/ruby/ruby-run-break-border.html >+ fast/ruby/ruby-run-break.html >+ fast/ruby/ruby-runs.html >+ fast/ruby/ruby-simple-rp.html >+ fast/ruby/ruby-simple.html >+ >+ Configuration file changes (mainly add ENABLE_RUBY flag): >+ * Configurations/FeatureDefines.xcconfig: >+ * DerivedSources.make: >+ * GNUmakefile.am: >+ * WebCore.gypi: >+ * WebCore.pro: >+ * WebCore.xcodeproj/project.pbxproj: >+ >+ * css/CSSStyleSelector.cpp: >+ (WebCore::CSSStyleSelector::styleForElement): loading of extra stylesheet for ruby >+ >+ * css/ruby.css: Added. Default stylesheet for ruby elements >+ >+ * rendering/InlineBox.h: >+ (WebCore::InlineBox::isRuby): query method >+ (WebCore::InlineBox::baselinePosition): virtual when ENABLE_RUBY is set, overridden by ruby >+ (WebCore::InlineBox::lineHeight): virtual when ENABLE_RUBY is set, overridden by ruby >+ * rendering/InlineFlowBox.cpp: >+ (WebCore::InlineFlowBox::placeBoxesVertically): adapt box placement for ruby inline flow boxes. >+ * rendering/RenderBlock.cpp: >+ (WebCore::RenderBlock::firstChildBoxInLayoutOrder): handle order in which block boxes are stacked, overridden by ruby >+ (WebCore::RenderBlock::nextChildBoxInLayoutOrder): handle order in which block boxes are stacked, overridden by ruby >+ (WebCore::RenderBlock::layoutBlockChildren): make use of above methods >+ * rendering/RenderBlock.h: >+ * rendering/RenderObject.cpp: >+ (WebCore::RenderObject::createObject): creation of ruby renderers >+ * rendering/RenderObject.h: >+ (WebCore::RenderObject::isRuby): information method added >+ (WebCore::RenderObject::isRubyRun): information method added >+ (WebCore::RenderObject::isRubyBase): information method added >+ (WebCore::RenderObject::isRubyText): information method added >+ * rendering/RenderRuby.cpp: Added. >+ (WebCore::RenderRubyAsInline::RenderRubyAsInline): >+ (WebCore::RenderRubyAsInline::~RenderRubyAsInline): >+ (WebCore::RenderRubyAsInline::isChildAllowed): >+ (WebCore::RenderRubyAsInline::addChild): >+ (WebCore::RenderRubyAsInline::createAnonymousRubyRun): >+ (WebCore::RenderRubyAsInline::createInlineFlowBox): >+ (WebCore::RenderRubyAsBlock::RenderRubyAsBlock): >+ (WebCore::RenderRubyAsBlock::~RenderRubyAsBlock): >+ (WebCore::RenderRubyAsBlock::isChildAllowed): >+ (WebCore::RenderRubyAsBlock::addChild): >+ (WebCore::RenderRubyAsBlock::createAnonymousRubyRun): >+ (WebCore::RenderRubyAsBlock::createRootInlineBox): >+ * rendering/RenderRuby.h: Added. >+ (WebCore::RenderRubyAsInline::renderName): >+ (WebCore::RenderRubyAsInline::isRuby): >+ (WebCore::RenderRubyAsBlock::renderName): >+ (WebCore::RenderRubyAsBlock::isRuby): >+ (WebCore::RenderRubyAsBlock::shouldPaintSelectionGaps): >+ * rendering/RenderRubyBase.cpp: Added. >+ (WebCore::RenderRubyBase::RenderRubyBase): >+ (WebCore::RenderRubyBase::~RenderRubyBase): >+ (WebCore::RenderRubyBase::isChildAllowed): >+ * rendering/RenderRubyBase.h: Added. >+ (WebCore::RenderRubyBase::renderName): >+ (WebCore::RenderRubyBase::isRubyBase): >+ * rendering/RenderRubyRun.cpp: Added. >+ (WebCore::RenderRubyRun::RenderRubyRun): >+ (WebCore::RenderRubyRun::~RenderRubyRun): >+ (WebCore::RenderRubyRun::hasRubyBase): >+ (WebCore::RenderRubyRun::numberOfRubyTexts): >+ (WebCore::RenderRubyRun::baselinePosition): >+ (WebCore::RenderRubyRun::firstLineBlock): >+ (WebCore::RenderRubyRun::updateFirstLetter): >+ (WebCore::RenderRubyRun::isChildAllowed): >+ (WebCore::RenderRubyRun::addChild): >+ (WebCore::RenderRubyRun::firstChildBoxInLayoutOrder): >+ (WebCore::RenderRubyRun::nextChildBoxInLayoutOrder): >+ (WebCore::RenderRubyRun::effectiveRubyPosition): >+ (WebCore::RenderRubyRun::getRubyBase): >+ (WebCore::RenderRubyRun::getFirstRubyText): >+ (WebCore::RenderRubyRun::getLastRubyText): >+ (WebCore::RenderRubyRun::createAnonymousRubyBase): >+ (WebCore::RenderRubyRun::createAnonymousRubyText): >+ * rendering/RenderRubyRun.h: Added. >+ (WebCore::RenderRubyRun::renderName): >+ (WebCore::RenderRubyRun::isRubyRun): >+ (WebCore::RenderRubyRun::isInlineBlockOrInlineTable): >+ (WebCore::RenderRubyRun::shouldPaintSelectionGaps): >+ * rendering/RenderRubyText.cpp: Added. >+ (WebCore::RenderRubyText::RenderRubyText): >+ (WebCore::RenderRubyText::~RenderRubyText): >+ (WebCore::RenderRubyText::isChildAllowed): >+ * rendering/RenderRubyText.h: Added. >+ (WebCore::RenderRubyText::renderName): >+ (WebCore::RenderRubyText::isRubyText): >+ * rendering/RenderTheme.h: >+ (WebCore::RenderTheme::extraRubyStyleSheet): extra stylesheet for ruby >+ * rendering/RubyInlineFlowBox.cpp: Added. >+ (WebCore::RubyInlineFlowBox::RubyInlineFlowBox): >+ (WebCore::RubyInlineFlowBox::virtualHeight): >+ (WebCore::RubyInlineFlowBox::baselinePosition): >+ (WebCore::RubyInlineFlowBox::computeHeightAndBaseline): >+ * rendering/RubyInlineFlowBox.h: Added. >+ (WebCore::RubyInlineFlowBox::isRuby): >+ (WebCore::RubyInlineFlowBox::lineHeight): >+ * rendering/RubyRootInlineBox.cpp: Added. >+ (WebCore::RubyRootInlineBox::RubyRootInlineBox): >+ * rendering/RubyRootInlineBox.h: Added. >+ (WebCore::RubyRootInlineBox::isRuby): >+ * rendering/style/RenderStyleConstants.h: >+ (WebCore::): >+ > 2009-07-13 Drew Wilson <atwilson@google.com> > > Reviewed by David Levin. >Index: WebCore/DerivedSources.make >=================================================================== >--- WebCore/DerivedSources.make (revision 45782) >+++ WebCore/DerivedSources.make (working copy) >@@ -523,6 +523,10 @@ XPathGrammar.cpp : xml/XPathGrammar.y $( > > USER_AGENT_STYLE_SHEETS = $(WebCore)/css/html.css $(WebCore)/css/quirks.css $(WebCore)/css/view-source.css $(WebCore)/css/themeWin.css $(WebCore)/css/themeWinQuirks.css > >+ifeq ($(findstring ENABLE_RUBY,$(FEATURE_DEFINES)), ENABLE_RUBY) >+ USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/css/ruby.css >+endif >+ > ifeq ($(findstring ENABLE_SVG,$(FEATURE_DEFINES)), ENABLE_SVG) > USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/css/svg.css > endif >@@ -558,6 +562,10 @@ ifeq ($(findstring ENABLE_VIDEO,$(FEATUR > HTML_FLAGS := $(HTML_FLAGS) ENABLE_VIDEO=1 > endif > >+ifeq ($(findstring ENABLE_RUBY,$(FEATURE_DEFINES)), ENABLE_RUBY) >+ HTML_FLAGS := $(HTML_FLAGS) ENABLE_RUBY=1 >+endif >+ > ifdef HTML_FLAGS > > HTMLElementFactory.cpp HTMLNames.cpp : dom/make_names.pl html/HTMLTagNames.in html/HTMLAttributeNames.in >Index: WebCore/GNUmakefile.am >=================================================================== >--- WebCore/GNUmakefile.am (revision 45782) >+++ WebCore/GNUmakefile.am (working copy) >@@ -2207,6 +2207,30 @@ webcore_libadd += \ > endif # END ENABLE_VIDEO > > # ---- >+# Ruby Support >+# ---- >+if ENABLE_RUBY >+ >+HTML_FEATURES += ENABLE_RUBY=1 >+webcore_cppflags += -DENABLE_RUBY=1 >+ >+webcore_sources += \ >+ WebCore/rendering/RenderRuby.cpp \ >+ WebCore/rendering/RenderRuby.h \ >+ WebCore/rendering/RenderRubyBase.cpp \ >+ WebCore/rendering/RenderRubyBase.h \ >+ WebCore/rendering/RenderRubyRun.cpp \ >+ WebCore/rendering/RenderRubyRun.h \ >+ WebCore/rendering/RenderRubyText.cpp \ >+ WebCore/rendering/RenderRubyText.h \ >+ WebCore/rendering/RubyInlineFlowBox.cpp \ >+ WebCore/rendering/RubyInlineFlowBox.h \ >+ WebCore/rendering/RubyRootInlineBox.cpp \ >+ WebCore/rendering/RubyRootInlineBox.h >+ >+endif # END ENABLE_RUBY >+ >+# ---- > # XPath Support > # ---- > if ENABLE_XPATH >@@ -3128,6 +3152,13 @@ USER_AGENT_STYLE_SHEETS = \ > $(WebCore)/css/wml.css \ > $(WebCore)/css/mediaControls.css > >+if ENABLE_RUBY >+# Note: ruby.css sets <rp> display:none, which we don't want if ruby isn't, in fact, enabled >+USER_AGENT_STYLE_SHEETS += \ >+ $(WebCore)/css/ruby.css >+endif # END ENABLE_RUBY >+ >+ > # new-style JavaScript bindings > SCRIPTS_BINDINGS = \ > $(WebCore)/bindings/scripts/CodeGenerator.pm \ >@@ -3272,6 +3303,13 @@ webcore_dist += \ > WebCore/xml/xmlattrs.in \ > WebCore/xml/XPathGrammar.y > >+if ENABLE_RUBY >+# Note: ruby.css sets <rp> display:none, which we don't want if ruby isn't, in fact, enabled >+webcore_dist += \ >+ WebCore/css/ruby.css >+endif # END ENABLE_RUBY >+ >+ > # Installing web inspector files > webinspectordir = ${datadir}/webkit-1.0/webinspector > dist_webinspector_DATA = \ >Index: WebCore/WebCore.gypi >=================================================================== >--- WebCore/WebCore.gypi (revision 45782) >+++ WebCore/WebCore.gypi (working copy) >@@ -2747,6 +2747,14 @@ > 'rendering/RenderReplaced.h', > 'rendering/RenderReplica.cpp', > 'rendering/RenderReplica.h', >+ 'rendering/RenderRuby.cpp', >+ 'rendering/RenderRuby.h', >+ 'rendering/RenderRubyBase.cpp', >+ 'rendering/RenderRubyBase.h', >+ 'rendering/RenderRubyRun.cpp', >+ 'rendering/RenderRubyRun.h', >+ 'rendering/RenderRubyText.cpp', >+ 'rendering/RenderRubyText.h', > 'rendering/RenderSVGBlock.cpp', > 'rendering/RenderSVGBlock.h', > 'rendering/RenderSVGContainer.cpp', >@@ -2832,6 +2840,10 @@ > 'rendering/RenderWordBreak.h', > 'rendering/RootInlineBox.cpp', > 'rendering/RootInlineBox.h', >+ 'rendering/RubyInlineFlowBox.cpp', >+ 'rendering/RubyInlineFlowBox.h', >+ 'rendering/RubyRootInlineBox.cpp', >+ 'rendering/RubyRootInlineBox.h', > 'rendering/ScrollBehavior.cpp', > 'rendering/ScrollBehavior.h', > 'rendering/SVGCharacterLayoutInfo.cpp', >Index: WebCore/WebCore.pro >=================================================================== >--- WebCore/WebCore.pro (revision 45782) >+++ WebCore/WebCore.pro (working copy) >@@ -138,6 +138,9 @@ contains(DEFINES, ENABLE_SINGLE_THREADED > DEFINES += ENABLE_SVG_FONTS=0 ENABLE_SVG_FOREIGN_OBJECT=0 ENABLE_SVG_ANIMATION=0 ENABLE_SVG_AS_IMAGE=0 ENABLE_SVG_USE=0 > } > >+# HTML5 ruby support >+!contains(DEFINES, ENABLE_RUBY=.): DEFINES += ENABLE_RUBY=1 >+ > # HTML5 media support > !contains(DEFINES, ENABLE_VIDEO=.) { > contains(QT_CONFIG, phonon):DEFINES += ENABLE_VIDEO=1 >@@ -1480,6 +1483,19 @@ contains(DEFINES, ENABLE_VIDEO=1) { > > } > >+contains(DEFINES, ENABLE_RUBY=1) { >+ STYLESHEETS_EMBED += \ >+ $$PWD/css/ruby.css >+ >+ SOURCES += \ >+ rendering/RenderRuby.cpp \ >+ rendering/RenderRubyBase.cpp \ >+ rendering/RenderRubyRun.cpp \ >+ rendering/RenderRubyText.cpp \ >+ rendering/RubyInlineFlowBox.cpp \ >+ rendering/RubyRootInlineBox.cpp >+} >+ > contains(DEFINES, ENABLE_XPATH=1) { > FEATURE_DEFINES_JAVASCRIPT += ENABLE_XPATH=1 > >Index: WebCore/Configurations/FeatureDefines.xcconfig >=================================================================== >--- WebCore/Configurations/FeatureDefines.xcconfig (revision 45782) >+++ WebCore/Configurations/FeatureDefines.xcconfig (working copy) >@@ -1,4 +1,5 @@ > // Copyright (C) 2009 Apple Inc. All rights reserved. >+// Copyright (C) 2009 Google Inc. All rights reserved. > // > // Redistribution and use in source and binary forms, with or without > // modification, are permitted provided that the following conditions >@@ -40,6 +41,7 @@ ENABLE_GEOLOCATION = ; > ENABLE_ICONDATABASE = ENABLE_ICONDATABASE; > ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER; > ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS; >+ENABLE_RUBY = ENABLE_RUBY; > ENABLE_SVG = ENABLE_SVG; > ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION; > ENABLE_SVG_AS_IMAGE = ENABLE_SVG_AS_IMAGE; >@@ -53,4 +55,4 @@ ENABLE_WORKERS = ENABLE_WORKERS; > ENABLE_XPATH = ENABLE_XPATH; > ENABLE_XSLT = ENABLE_XSLT; > >-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DOM_STORAGE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT); >+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DOM_STORAGE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT); >Index: WebCore/WebCore.xcodeproj/project.pbxproj >=================================================================== >--- WebCore/WebCore.xcodeproj/project.pbxproj (revision 45782) >+++ WebCore/WebCore.xcodeproj/project.pbxproj (working copy) >@@ -184,6 +184,19 @@ > 142011B70A003133008303F9 /* JSCSSStyleDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */; }; > 1432E8470C51493800B1500F /* GCController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1432E8460C51493800B1500F /* GCController.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 1432E8490C51493F00B1500F /* GCController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1432E8480C51493F00B1500F /* GCController.cpp */; }; >+ 1433C340100B0F6E004D631C /* ruby.css in Resources */ = {isa = PBXBuildFile; fileRef = 1433C33F100B0F6E004D631C /* ruby.css */; }; >+ 1433C349100B0FAC004D631C /* RenderRuby.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1433C341100B0FAC004D631C /* RenderRuby.cpp */; }; >+ 1433C34A100B0FAC004D631C /* RenderRuby.h in Headers */ = {isa = PBXBuildFile; fileRef = 1433C342100B0FAC004D631C /* RenderRuby.h */; }; >+ 1433C34B100B0FAC004D631C /* RenderRubyBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1433C343100B0FAC004D631C /* RenderRubyBase.cpp */; }; >+ 1433C34C100B0FAC004D631C /* RenderRubyBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 1433C344100B0FAC004D631C /* RenderRubyBase.h */; }; >+ 1433C34D100B0FAC004D631C /* RenderRubyRun.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1433C345100B0FAC004D631C /* RenderRubyRun.cpp */; }; >+ 1433C34E100B0FAC004D631C /* RenderRubyRun.h in Headers */ = {isa = PBXBuildFile; fileRef = 1433C346100B0FAC004D631C /* RenderRubyRun.h */; }; >+ 1433C34F100B0FAC004D631C /* RenderRubyText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1433C347100B0FAC004D631C /* RenderRubyText.cpp */; }; >+ 1433C350100B0FAC004D631C /* RenderRubyText.h in Headers */ = {isa = PBXBuildFile; fileRef = 1433C348100B0FAC004D631C /* RenderRubyText.h */; }; >+ 1433C355100B0FBB004D631C /* RubyInlineFlowBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1433C351100B0FBB004D631C /* RubyInlineFlowBox.cpp */; }; >+ 1433C356100B0FBB004D631C /* RubyInlineFlowBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 1433C352100B0FBB004D631C /* RubyInlineFlowBox.h */; }; >+ 1433C357100B0FBB004D631C /* RubyRootInlineBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1433C353100B0FBB004D631C /* RubyRootInlineBox.cpp */; }; >+ 1433C358100B0FBB004D631C /* RubyRootInlineBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 1433C354100B0FBB004D631C /* RubyRootInlineBox.h */; }; > 1477E7760BF4134A00152872 /* PageCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1477E7740BF4134A00152872 /* PageCache.cpp */; }; > 1477E7770BF4134A00152872 /* PageCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1477E7750BF4134A00152872 /* PageCache.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 148AFDA50AF58360008CC700 /* ExceptionHandlers.h in Headers */ = {isa = PBXBuildFile; fileRef = 148AFDA30AF58360008CC700 /* ExceptionHandlers.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -5085,6 +5098,19 @@ > 142011B50A003133008303F9 /* JSCSSStyleDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSCSSStyleDeclaration.h; sourceTree = "<group>"; }; > 1432E8460C51493800B1500F /* GCController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GCController.h; sourceTree = "<group>"; }; > 1432E8480C51493F00B1500F /* GCController.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = GCController.cpp; sourceTree = "<group>"; }; >+ 1433C33F100B0F6E004D631C /* ruby.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = ruby.css; sourceTree = "<group>"; }; >+ 1433C341100B0FAC004D631C /* RenderRuby.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderRuby.cpp; sourceTree = "<group>"; }; >+ 1433C342100B0FAC004D631C /* RenderRuby.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderRuby.h; sourceTree = "<group>"; }; >+ 1433C343100B0FAC004D631C /* RenderRubyBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderRubyBase.cpp; sourceTree = "<group>"; }; >+ 1433C344100B0FAC004D631C /* RenderRubyBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderRubyBase.h; sourceTree = "<group>"; }; >+ 1433C345100B0FAC004D631C /* RenderRubyRun.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderRubyRun.cpp; sourceTree = "<group>"; }; >+ 1433C346100B0FAC004D631C /* RenderRubyRun.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderRubyRun.h; sourceTree = "<group>"; }; >+ 1433C347100B0FAC004D631C /* RenderRubyText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderRubyText.cpp; sourceTree = "<group>"; }; >+ 1433C348100B0FAC004D631C /* RenderRubyText.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderRubyText.h; sourceTree = "<group>"; }; >+ 1433C351100B0FBB004D631C /* RubyInlineFlowBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RubyInlineFlowBox.cpp; sourceTree = "<group>"; }; >+ 1433C352100B0FBB004D631C /* RubyInlineFlowBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RubyInlineFlowBox.h; sourceTree = "<group>"; }; >+ 1433C353100B0FBB004D631C /* RubyRootInlineBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RubyRootInlineBox.cpp; sourceTree = "<group>"; }; >+ 1433C354100B0FBB004D631C /* RubyRootInlineBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RubyRootInlineBox.h; sourceTree = "<group>"; }; > 1477E7740BF4134A00152872 /* PageCache.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PageCache.cpp; sourceTree = "<group>"; }; > 1477E7750BF4134A00152872 /* PageCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PageCache.h; sourceTree = "<group>"; }; > 14813BF309EDF88E00F757E1 /* IDLParser.pm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.perl; name = IDLParser.pm; path = scripts/IDLParser.pm; sourceTree = "<group>"; }; >@@ -14224,6 +14250,7 @@ > BC4368E70C226E32005EFB5F /* Rect.h */, > A80E79960A19BD21007FB8C5 /* Rect.idl */, > 858C38EF0AA8FDD100B187A4 /* RGBColor.idl */, >+ 1433C33F100B0F6E004D631C /* ruby.css */, > A80E6CCA0A1989CA007FB8C5 /* ShadowValue.cpp */, > A80E6CBE0A1989CA007FB8C5 /* ShadowValue.h */, > A80E734C0A199C77007FB8C5 /* StyleBase.cpp */, >@@ -14368,6 +14395,14 @@ > A871DFDF0A15376B00B12A68 /* RenderReplaced.h */, > BCA846D40DC67A350026C309 /* RenderReplica.cpp */, > BCA846D50DC67A350026C309 /* RenderReplica.h */, >+ 1433C341100B0FAC004D631C /* RenderRuby.cpp */, >+ 1433C342100B0FAC004D631C /* RenderRuby.h */, >+ 1433C343100B0FAC004D631C /* RenderRubyBase.cpp */, >+ 1433C344100B0FAC004D631C /* RenderRubyBase.h */, >+ 1433C345100B0FAC004D631C /* RenderRubyRun.cpp */, >+ 1433C346100B0FAC004D631C /* RenderRubyRun.h */, >+ 1433C347100B0FAC004D631C /* RenderRubyText.cpp */, >+ 1433C348100B0FAC004D631C /* RenderRubyText.h */, > BC3BE9900E9C1C7C00835588 /* RenderScrollbar.cpp */, > BC3BE9910E9C1C7C00835588 /* RenderScrollbar.h */, > BC3BE9AA0E9C242000835588 /* RenderScrollbarPart.cpp */, >@@ -14441,6 +14476,10 @@ > 93799EF70BF2743600D0F230 /* RenderWordBreak.h */, > A8CFF5E00A155A05000A4234 /* RootInlineBox.cpp */, > A8CFF5DA0A155A05000A4234 /* RootInlineBox.h */, >+ 1433C351100B0FBB004D631C /* RubyInlineFlowBox.cpp */, >+ 1433C352100B0FBB004D631C /* RubyInlineFlowBox.h */, >+ 1433C353100B0FBB004D631C /* RubyRootInlineBox.cpp */, >+ 1433C354100B0FBB004D631C /* RubyRootInlineBox.h */, > 5D925B650F64D4DD00B847F0 /* ScrollBehavior.cpp */, > 5D925B660F64D4DD00B847F0 /* ScrollBehavior.h */, > B2B33A5D0B887CEF00C15984 /* SVGCharacterLayoutInfo.cpp */, >@@ -16965,6 +17004,12 @@ > 93F199ED08245E59001E9ABC /* XSLTProcessor.h in Headers */, > E1BE512E0CF6C512002EA959 /* XSLTUnicodeSort.h in Headers */, > 97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */, >+ 1433C34A100B0FAC004D631C /* RenderRuby.h in Headers */, >+ 1433C34C100B0FAC004D631C /* RenderRubyBase.h in Headers */, >+ 1433C34E100B0FAC004D631C /* RenderRubyRun.h in Headers */, >+ 1433C350100B0FAC004D631C /* RenderRubyText.h in Headers */, >+ 1433C356100B0FBB004D631C /* RubyInlineFlowBox.h in Headers */, >+ 1433C358100B0FBB004D631C /* RubyRootInlineBox.h in Headers */, > ); > runOnlyForDeploymentPostprocessing = 0; > }; >@@ -17074,6 +17119,7 @@ > 85136CA80AED665900F90A3D /* westResizeCursor.png in Resources */, > 1AB1AE7A0C051FDE00139F4F /* zoomInCursor.png in Resources */, > 1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */, >+ 1433C340100B0F6E004D631C /* ruby.css in Resources */, > ); > runOnlyForDeploymentPostprocessing = 0; > }; >@@ -18987,6 +19033,12 @@ > 93F19B0408245E59001E9ABC /* XSLTProcessor.cpp in Sources */, > E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */, > 97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */, >+ 1433C349100B0FAC004D631C /* RenderRuby.cpp in Sources */, >+ 1433C34B100B0FAC004D631C /* RenderRubyBase.cpp in Sources */, >+ 1433C34D100B0FAC004D631C /* RenderRubyRun.cpp in Sources */, >+ 1433C34F100B0FAC004D631C /* RenderRubyText.cpp in Sources */, >+ 1433C355100B0FBB004D631C /* RubyInlineFlowBox.cpp in Sources */, >+ 1433C357100B0FBB004D631C /* RubyRootInlineBox.cpp in Sources */, > ); > runOnlyForDeploymentPostprocessing = 0; > }; >Index: WebCore/css/CSSStyleSelector.cpp >=================================================================== >--- WebCore/css/CSSStyleSelector.cpp (revision 45782) >+++ WebCore/css/CSSStyleSelector.cpp (working copy) >@@ -6,6 +6,7 @@ > * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> > * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> > * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) >+ * Copyright (C) 2009 Google Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -1145,6 +1146,17 @@ PassRefPtr<RenderStyle> CSSStyleSelector > } > #endif > >+#if ENABLE(RUBY) >+ static bool loadedRubyStyleSheet; >+ if (!loadedRubyStyleSheet && (e->hasTagName(rubyTag) || e->hasTagName(rpTag) || e->hasTagName(rtTag))) { >+ loadedRubyStyleSheet = true; >+ String rubyRules = String(rubyUserAgentStyleSheet, sizeof(rubyUserAgentStyleSheet)) + RenderTheme::defaultTheme()->extraRubyStyleSheet(); >+ CSSStyleSheet* rubySheet = parseUASheet(rubyRules); >+ defaultStyle->addRulesFromSheet(rubySheet, screenEval()); >+ defaultPrintStyle->addRulesFromSheet(rubySheet, printEval()); >+ } >+#endif >+ > int firstUARule = -1, lastUARule = -1; > int firstUserRule = -1, lastUserRule = -1; > int firstAuthorRule = -1, lastAuthorRule = -1; >Index: WebCore/css/ruby.css >=================================================================== >--- WebCore/css/ruby.css (revision 0) >+++ WebCore/css/ruby.css (revision 0) >@@ -0,0 +1,45 @@ >+/* >+ * Copyright (C) 2009 Apple Inc. All rights reserved. >+ * Copyright (C) 2009 Google 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, >+ * 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. >+ */ >+ >+/* ruby HTML elements */ >+ >+ruby { >+ display: inline; >+} >+ >+rt { >+ display: inline-block; >+} >+ >+ruby > rt { >+ display: block; >+ font-size: 60%; /* make slightly larger than 50% for better readability */ >+ text-align: center; >+} >+ >+ruby > rp { >+ display: none; >+} >+ >Index: WebCore/rendering/InlineBox.h >=================================================================== >--- WebCore/rendering/InlineBox.h (revision 45782) >+++ WebCore/rendering/InlineBox.h (working copy) >@@ -137,6 +137,9 @@ public: > virtual bool isInlineFlowBox() const { return false; } > virtual bool isInlineTextBox() { return false; } > virtual bool isRootInlineBox() const { return false; } >+#if ENABLE(RUBY) >+ virtual bool isRuby() const { return false; } >+#endif > #if ENABLE(SVG) > virtual bool isSVGRootInlineBox() { return false; } > >@@ -205,8 +208,14 @@ public: > > int height() const; > >- inline int baselinePosition(bool isRootLineBox) const { return renderer()->baselinePosition(m_firstLine, isRootLineBox); } >- inline int lineHeight(bool isRootLineBox) const { return renderer()->lineHeight(m_firstLine, isRootLineBox); } >+#if ENABLE(RUBY) >+ // the bool parameter is only necessary for compatibility when ENABLE(RUBY) is false >+ virtual int baselinePosition(bool isRootLineBox) const { return renderer()->baselinePosition(m_firstLine, isRootLineBox); } >+ virtual int lineHeight(bool isRootLineBox) const { return renderer()->lineHeight(m_firstLine, isRootLineBox); } >+#else >+ inline int baselinePosition(bool isRootLineBox) const { return renderer()->baselinePosition(m_firstLine, isRootLineBox); } >+ inline int lineHeight(bool isRootLineBox) const { return renderer()->lineHeight(m_firstLine, isRootLineBox); } >+#endif > > virtual int topOverflow() const { return y(); } > virtual int bottomOverflow() const { return y() + height(); } >Index: WebCore/rendering/InlineFlowBox.cpp >=================================================================== >--- WebCore/rendering/InlineFlowBox.cpp (revision 45782) >+++ WebCore/rendering/InlineFlowBox.cpp (working copy) >@@ -520,9 +520,17 @@ void InlineFlowBox::placeBoxesVertically > int overflowTop = 0; > int overflowBottom = 0; > if (curr->isText() || curr->isInlineFlowBox()) { >- const Font& font = curr->renderer()->style(m_firstLine)->font(); >- newY += curr->baselinePosition(false) - font.ascent(); >- >+#if ENABLE(RUBY) >+ if (!curr->isRuby()) >+#endif >+ { >+ const Font& font = curr->renderer()->style(m_firstLine)->font(); >+ newY += curr->baselinePosition(false) - font.ascent(); >+ >+ if (curr->isInlineFlowBox()) >+ newY -= curr->boxModelObject()->borderTop() + curr->boxModelObject()->paddingTop(); >+ } >+ > for (ShadowData* shadow = curr->renderer()->style()->textShadow(); shadow; shadow = shadow->next) { > overflowTop = min(overflowTop, shadow->y - shadow->blur); > overflowBottom = max(overflowBottom, shadow->y + shadow->blur); >@@ -543,9 +551,6 @@ void InlineFlowBox::placeBoxesVertically > overflowTop = min(overflowTop, box->reflectionBox().y()); > overflowBottom = max(overflowBottom, box->reflectionBox().bottom()); > } >- >- if (curr->isInlineFlowBox()) >- newY -= curr->boxModelObject()->borderTop() + curr->boxModelObject()->paddingTop(); > } else if (!curr->renderer()->isBR()) { > RenderBox* box = toRenderBox(curr->renderer()); > newY += box->marginTop(); >Index: WebCore/rendering/RenderBlock.cpp >=================================================================== >--- WebCore/rendering/RenderBlock.cpp (revision 45782) >+++ WebCore/rendering/RenderBlock.cpp (working copy) >@@ -1305,6 +1305,16 @@ void RenderBlock::handleBottomOfBlock(in > setCollapsedBottomMargin(marginInfo); > } > >+RenderBox* RenderBlock::firstChildBoxInLayoutOrder() const >+{ >+ return firstChildBox(); >+} >+ >+RenderBox* RenderBlock::nextChildBoxInLayoutOrder(RenderBox* child) const >+{ >+ return child->nextSiblingBox(); >+} >+ > void RenderBlock::layoutBlockChildren(bool relayoutChildren, int& maxFloatBottom) > { > if (gPercentHeightDescendantsMap) { >@@ -1341,11 +1351,11 @@ void RenderBlock::layoutBlockChildren(bo > int previousFloatBottom = 0; > maxFloatBottom = 0; > >- RenderBox* next = firstChildBox(); >+ RenderBox* next = firstChildBoxInLayoutOrder(); > > while (next) { > RenderBox* child = next; >- next = child->nextSiblingBox(); >+ next = nextChildBoxInLayoutOrder(child); > > if (legend == child) > continue; // Skip the legend, since it has already been positioned up in the fieldset's border. >Index: WebCore/rendering/RenderBlock.h >=================================================================== >--- WebCore/rendering/RenderBlock.h (revision 45782) >+++ WebCore/rendering/RenderBlock.h (working copy) >@@ -352,6 +352,14 @@ protected: > virtual bool hasLineIfEmpty() const; > bool layoutOnlyPositionedObjects(); > >+protected: >+#if ENABLE(RUBY) >+ virtual RenderBox* firstChildBoxInLayoutOrder() const; // overridden by ruby >+ virtual RenderBox* nextChildBoxInLayoutOrder(RenderBox* childBox) const; // overridden by ruby >+#else >+ RenderBox* firstChildBoxInLayoutOrder() const; >+ RenderBox* nextChildBoxInLayoutOrder(RenderBox* childBox) const; >+#endif > > private: > Position positionForBox(InlineBox*, bool start = true) const; >Index: WebCore/rendering/RenderObject.cpp >=================================================================== >--- WebCore/rendering/RenderObject.cpp (revision 45782) >+++ WebCore/rendering/RenderObject.cpp (working copy) >@@ -4,6 +4,7 @@ > * (C) 2000 Dirk Mueller (mueller@kde.org) > * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) > * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. >+ * Copyright (C) 2009 Google Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -51,6 +52,11 @@ > #include <wtf/RefCountedLeakCounter.h> > #include <wtf/UnusedParam.h> > >+#if ENABLE(RUBY) >+#include "RenderRuby.h" >+#include "RenderRubyText.h" >+#endif >+ > #if USE(ACCELERATED_COMPOSITING) > #include "RenderLayerCompositor.h" > #endif >@@ -101,56 +107,52 @@ RenderObject* RenderObject::createObject > return image; > } > >- RenderObject* o = 0; >+#if ENABLE(RUBY) >+ if (node->hasTagName(rubyTag)) { >+ if (style->display() == INLINE) >+ return new (arena) RenderRubyAsInline(node); >+ else >+ return new (arena) RenderRubyAsBlock(node); >+ } >+ // treat <rt> as ruby text ONLY if it still has its default treatment of block >+ if (node->hasTagName(rtTag) && style->display() == BLOCK) >+ return new (arena) RenderRubyText(node); >+#endif > > switch (style->display()) { > case NONE: >- break; >+ return 0; > case INLINE: >- o = new (arena) RenderInline(node); >- break; >+ return new (arena) RenderInline(node); > case BLOCK: >- o = new (arena) RenderBlock(node); >- break; > case INLINE_BLOCK: >- o = new (arena) RenderBlock(node); >- break; >- case LIST_ITEM: >- o = new (arena) RenderListItem(node); >- break; > case RUN_IN: > case COMPACT: >- o = new (arena) RenderBlock(node); >- break; >+ return new (arena) RenderBlock(node); >+ case LIST_ITEM: >+ return new (arena) RenderListItem(node); > case TABLE: > case INLINE_TABLE: >- o = new (arena) RenderTable(node); >- break; >+ return new (arena) RenderTable(node); > case TABLE_ROW_GROUP: > case TABLE_HEADER_GROUP: > case TABLE_FOOTER_GROUP: >- o = new (arena) RenderTableSection(node); >- break; >+ return new (arena) RenderTableSection(node); > case TABLE_ROW: >- o = new (arena) RenderTableRow(node); >- break; >+ return new (arena) RenderTableRow(node); > case TABLE_COLUMN_GROUP: > case TABLE_COLUMN: >- o = new (arena) RenderTableCol(node); >- break; >+ return new (arena) RenderTableCol(node); > case TABLE_CELL: >- o = new (arena) RenderTableCell(node); >- break; >+ return new (arena) RenderTableCell(node); > case TABLE_CAPTION: >- o = new (arena) RenderBlock(node); >- break; >+ return new (arena) RenderBlock(node); > case BOX: > case INLINE_BOX: >- o = new (arena) RenderFlexibleBox(node); >- break; >+ return new (arena) RenderFlexibleBox(node); > } > >- return o; >+ return 0; > } > > #ifndef NDEBUG >Index: WebCore/rendering/RenderObject.h >=================================================================== >--- WebCore/rendering/RenderObject.h (revision 45782) >+++ WebCore/rendering/RenderObject.h (working copy) >@@ -4,6 +4,7 @@ > * (C) 2000 Dirk Mueller (mueller@kde.org) > * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) > * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. >+ * Copyright (C) 2009 Google Inc. All rights reserved. > * > * This library is free software; you can redistribute it and/or > * modify it under the terms of the GNU Library General Public >@@ -292,6 +293,13 @@ public: > bool cellWidthChanged() const { return m_cellWidthChanged; } > void setCellWidthChanged(bool b = true) { m_cellWidthChanged = b; } > >+#if ENABLE(RUBY) >+ virtual bool isRuby() const { return false; } >+ virtual bool isRubyRun() const { return false; } >+ virtual bool isRubyBase() const { return false; } >+ virtual bool isRubyText() const { return false; } >+#endif >+ > #if ENABLE(SVG) > // FIXME: Until all SVG renders can be subclasses of RenderSVGModelObject we have > // to add SVG renderer methods to RenderObject with an ASSERT_NOT_REACHED() default implementation. >Index: WebCore/rendering/RenderRuby.cpp >=================================================================== >--- WebCore/rendering/RenderRuby.cpp (revision 0) >+++ WebCore/rendering/RenderRuby.cpp (revision 0) >@@ -0,0 +1,144 @@ >+/* >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+#include "RenderRuby.h" >+ >+#if ENABLE(RUBY) >+ >+#include "RenderRubyRun.h" >+#include "RubyInlineFlowBox.h" >+#include "RubyRootInlineBox.h" >+ >+namespace WebCore { >+ >+//=== ruby as inline object === >+ >+RenderRubyAsInline::RenderRubyAsInline(Node* node) >+ : RenderInline(node) >+{ >+} >+ >+RenderRubyAsInline::~RenderRubyAsInline() >+{ >+} >+ >+bool RenderRubyAsInline::isChildAllowed(RenderObject* child, RenderStyle*) const >+{ >+ return child->isRubyRun() >+ || child->isRubyBase() >+ || child->isRubyText() >+ || child->isInline(); >+} >+ >+void RenderRubyAsInline::addChild(RenderObject* child, RenderObject* beforeChild) >+{ >+ // only RenderRubyRun objects can be directly added as a child, everything else must be wrapped. >+ if (child->isRubyRun()) { >+ RenderInline::addChild(child, beforeChild); >+ return; >+ } >+ // if it's a ruby text, then check if we can add it to the previous run >+ if (child->isRubyText()) { >+ RenderObject* prev = beforeChild ? beforeChild->previousSibling() : lastChild(); >+ if (prev && prev->isRubyRun()) { >+ prev->addChild(child); >+ return; >+ } >+ } >+ // can't add, or not a ruby text -> must create new run and add it there >+ RenderObject* rr = createAnonymousRubyRun(); >+ addChild(rr, beforeChild); >+ rr->addChild(child); >+} >+ >+RenderRubyRun* RenderRubyAsInline::createAnonymousRubyRun() >+{ >+ RenderRubyRun* rr = new (renderArena()) RenderRubyRun(document() /* anonymous */); >+ RefPtr<RenderStyle> newStyle = RenderStyle::create(); >+ newStyle->inheritFrom(style()); >+ newStyle->setDisplay(INLINE_BLOCK); // FIXME: use INLINE_TABLE or a special WEBKIT_RUBY_RUN instead?? >+ rr->setStyle(newStyle.release()); >+ return rr; >+} >+ >+InlineFlowBox* RenderRubyAsInline::createInlineFlowBox() >+{ >+ return new (renderArena()) RubyInlineFlowBox(this); >+} >+ >+//=== ruby as block object === >+ >+RenderRubyAsBlock::RenderRubyAsBlock(Node* node) >+ : RenderBlock(node) >+{ >+} >+ >+RenderRubyAsBlock::~RenderRubyAsBlock() >+{ >+} >+ >+bool RenderRubyAsBlock::isChildAllowed(RenderObject* child, RenderStyle*) const >+{ >+ return child->isRubyRun() >+ || child->isRubyBase() >+ || child->isRubyText() >+ || child->isInline(); >+} >+ >+void RenderRubyAsBlock::addChild(RenderObject* child, RenderObject* beforeChild) >+{ >+ // only RenderRubyRun objects can be directly added as a child, everything else must be wrapped. >+ if (child->isRubyRun()) { >+ RenderBlock::addChild(child, beforeChild); >+ return; >+ } >+ // if it's a ruby text, then check if we can add it to the previous run >+ if (child->isRubyText()) { >+ RenderObject* prev = beforeChild ? beforeChild->previousSibling() : lastChild(); >+ if (prev && prev->isRubyRun()) { >+ prev->addChild(child); >+ return; >+ } >+ } >+ // can't add, or not a ruby text -> must create new run and add it there >+ RenderObject* rr = createAnonymousRubyRun(); >+ addChild(rr, beforeChild); >+ rr->addChild(child); >+} >+ >+RenderRubyRun* RenderRubyAsBlock::createAnonymousRubyRun() >+{ >+ RenderRubyRun* rr = new (renderArena()) RenderRubyRun(document() /* anonymous */); >+ RefPtr<RenderStyle> newStyle = RenderStyle::create(); >+ newStyle->inheritFrom(style()); >+ newStyle->setDisplay(INLINE_BLOCK); // FIXME: use INLINE_TABLE or a special WEBKIT_RUBY_RUN instead?? >+ rr->setStyle(newStyle.release()); >+ return rr; >+} >+ >+RootInlineBox* RenderRubyAsBlock::createRootInlineBox() >+{ >+ return new (renderArena()) RubyRootInlineBox(this); >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >+ >Index: WebCore/rendering/RenderRuby.h >=================================================================== >--- WebCore/rendering/RenderRuby.h (revision 0) >+++ WebCore/rendering/RenderRuby.h (revision 0) >@@ -0,0 +1,92 @@ >+/* >+ * This file is part of the WebKit project. >+ * >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ * >+ */ >+ >+#ifndef RenderRuby_h >+#define RenderRuby_h >+ >+#if ENABLE(RUBY) >+ >+#include "RenderInline.h" >+#include "RenderBlock.h" >+ >+namespace WebCore { >+ >+class RenderRubyRun; >+ >+// Following the HTML 5 spec, the box object model for a <ruby> element looks as follows: >+// >+// 1 RenderRuby object, corresponding to the whole <ruby> HTML element >+// 1+ RenderRubyRun object(s), each one wrapping a ruby base with its corresponding ruby text(s) >+// 1 RenderRubyBase object >+// n inline object(s) >+// 0+ RenderRubyText object(s) >+// n inline object(s) >+// >+// Note: <rp> elements are defined as having 'display:none' and thus normally are not assigned a renderer. >+// >+// This structure allows both several runs of ruby bases with their respective ruby texts (see HTML5 spec). >+ >+// <ruby> when used as 'display:inline' >+class RenderRubyAsInline : public RenderInline { >+public: >+ RenderRubyAsInline(Node*); >+ virtual ~RenderRubyAsInline(); >+ >+ virtual const char* renderName() const { return "RenderRuby (inline)"; } >+ >+ virtual bool isRuby() const { return true; } >+ >+ virtual bool isChildAllowed(RenderObject*, RenderStyle*) const; >+ virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0); >+ >+ InlineFlowBox* createInlineFlowBox(); >+ >+private: >+ RenderRubyRun* createAnonymousRubyRun(); >+}; >+ >+// <ruby> when used as 'display:block' or 'display:inline-block' >+class RenderRubyAsBlock : public RenderBlock { >+public: >+ RenderRubyAsBlock(Node*); >+ virtual ~RenderRubyAsBlock(); >+ >+ virtual const char* renderName() const { return "RenderRuby (block)"; } >+ >+ virtual bool isRuby() const { return true; } >+ >+ virtual bool isChildAllowed(RenderObject*, RenderStyle*) const; >+ virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0); >+ >+ virtual bool shouldPaintSelectionGaps() const { return false; } >+ >+ virtual RootInlineBox* createRootInlineBox(); >+ >+private: >+ RenderRubyRun* createAnonymousRubyRun(); >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >+ >+#endif // RenderRuby_h >Index: WebCore/rendering/RenderRubyBase.cpp >=================================================================== >--- WebCore/rendering/RenderRubyBase.cpp (revision 0) >+++ WebCore/rendering/RenderRubyBase.cpp (revision 0) >@@ -0,0 +1,45 @@ >+/* >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+#include "RenderRubyBase.h" >+ >+#if ENABLE(RUBY) >+ >+namespace WebCore { >+ >+RenderRubyBase::RenderRubyBase(Node* node) >+ : RenderBlock(node) >+{ >+ setInline(false); >+} >+ >+RenderRubyBase::~RenderRubyBase() >+{ >+} >+ >+bool RenderRubyBase::isChildAllowed(RenderObject* child, RenderStyle*) const >+{ >+ return child->isInline(); >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >+ >Index: WebCore/rendering/RenderRubyBase.h >=================================================================== >--- WebCore/rendering/RenderRubyBase.h (revision 0) >+++ WebCore/rendering/RenderRubyBase.h (revision 0) >@@ -0,0 +1,48 @@ >+/* >+ * This file is part of the WebKit project. >+ * >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ * >+ */ >+ >+#ifndef RenderRubyBase_h >+#define RenderRubyBase_h >+ >+#if ENABLE(RUBY) >+ >+#include "RenderBlock.h" >+ >+namespace WebCore { >+ >+class RenderRubyBase : public RenderBlock{ >+public: >+ RenderRubyBase(Node*); >+ virtual ~RenderRubyBase(); >+ >+ virtual const char* renderName() const { return isAnonymous() ? "RenderRubyBase (anonymous)" : "RenderRubyBase"; } >+ >+ virtual bool isRubyBase() const { return true; } >+ >+ virtual bool isChildAllowed(RenderObject*, RenderStyle*) const; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >+ >+#endif // RenderRubyBase_h >Index: WebCore/rendering/RenderRubyRun.cpp >=================================================================== >--- WebCore/rendering/RenderRubyRun.cpp (revision 0) >+++ WebCore/rendering/RenderRubyRun.cpp (revision 0) >@@ -0,0 +1,241 @@ >+/* >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+#include "RenderRubyRun.h" >+ >+#if ENABLE(RUBY) >+ >+#include "RenderRubyBase.h" >+#include "RenderRubyText.h" >+#include "RenderView.h" >+ >+using namespace std; >+ >+namespace WebCore { >+ >+RenderRubyRun::RenderRubyRun(Node* node) >+ : RenderBlock(node) >+{ >+ setReplaced(true); >+ setInline(true); >+} >+ >+RenderRubyRun::~RenderRubyRun() >+{ >+} >+ >+bool RenderRubyRun::hasRubyBase() const >+{ >+ // normally, the base should be the first child (provided it has already been added) >+ ASSERT(!firstChild() || firstChild()->isRubyBase()); >+ >+ return getRubyBase(); >+} >+ >+int RenderRubyRun::numberOfRubyTexts() const >+{ >+ // normally, the first child should be the base, not a text >+ ASSERT(!firstChild() || firstChild()->isRubyBase()); >+ >+ int n = 0; >+ for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { >+ if (child->isRubyText()) >+ ++n; >+ } >+ return n; >+} >+ >+int RenderRubyRun::baselinePosition(bool firstLine, bool isRootLineBox) const >+{ >+ RenderRubyBase* rb = getRubyBase(); >+ // FIXME: should we pass 'isRootLineBox' below, or just 'false'? >+ return rb ? rb->y() + rb->baselinePosition(firstLine, isRootLineBox) : -1; >+} >+ >+RenderBlock* RenderRubyRun::firstLineBlock() const >+{ >+ return 0; >+} >+ >+void RenderRubyRun::updateFirstLetter() >+{ >+} >+ >+bool RenderRubyRun::isChildAllowed(RenderObject* child, RenderStyle*) const >+{ >+ return child->isRubyBase() >+ || child->isRubyText() >+ || child->isInline(); >+} >+ >+void RenderRubyRun::addChild(RenderObject* child, RenderObject* beforeChild) >+{ >+ if (!beforeChild && isAfterContent(lastChild())) >+ beforeChild = lastChild(); >+ >+ // RenderRubyText >+ if (child->isRubyText()) { >+ RenderBlock::addChild(child, beforeChild); >+ return; >+ } >+ // RenderRubyBase >+ if (child->isRubyBase()) { >+ RenderBlock::addChild(child, beforeChild); >+ return; >+ } >+ // plain text or other inline elements -> append to previous RenderRubyBase if existent, otherwise create anonymous RenderRubyBase >+ RenderObject* prev = beforeChild ? beforeChild->previousSibling() : lastChild(); >+ if (prev && prev->isRubyBase()) { >+ prev->addChild(child); >+ return; >+ } >+ RenderObject* rb = createAnonymousRubyBase(); >+ addChild(rb, beforeChild); >+ rb->addChild(child); >+} >+ >+RenderBox* RenderRubyRun::firstChildBoxInLayoutOrder() const >+{ >+ ASSERT(hasRubyBase()); >+ >+ // first layout all 'BEFORE' texts, in reverse order >+ for (RenderBox* child = lastChildBox(); child; child = child->previousSiblingBox()) { >+ if (child->isRubyText() && effectiveRubyPosition(child) == RP_BEFORE) >+ return child; >+ } >+ >+ // if there are no 'BEFORE' texts, start with the base >+ // (this shouldn't return NULL - if it does it just means that we also disregard all 'AFTER' texts) >+ return getRubyBase(); >+} >+ >+RenderBox* RenderRubyRun::nextChildBoxInLayoutOrder(RenderBox* child) const >+{ >+ ASSERT(hasRubyBase()); >+ >+ // if the current child is a 'BEFORE' text, search for other BEFORE texts in reverse order >+ // Note: there should only be 1 such text per se, but even in well-formed HTML/CSS, the designer could >+ // have explicitely set 'ruby-position: before' for all texts (once we support ruby-position) >+ if (child->isRubyText() && effectiveRubyPosition(child) == RP_BEFORE) { >+ for (child = child->previousSiblingBox(); child; child = child->previousSiblingBox()) { >+ if (child->isRubyText() && effectiveRubyPosition(child) == RP_BEFORE) >+ return child; >+ } >+ >+ // no other 'BEFORE' texts found, continue with the base container >+ // (this shouldn't return NULL - if it does it just means that we also disregard all 'AFTER' texts) >+ return getRubyBase(); >+ } >+ >+ // if we just had a ruby base, then for defense-depth purposes, look for other bases just to be sure >+ if (child->isRubyBase()) { >+ for (child = child->nextSiblingBox(); child; child = child->nextSiblingBox()) { >+ if (child->isRubyBase()) { >+ ASSERT(false); // this shouldn't happen, the 2nd base should have formed a new RenderRubyRun >+ return child; >+ } >+ } >+ >+ // if there are no spurious additional bases, return the first AFTER text >+ for (child = firstChildBox(); child; child = child->nextSiblingBox()) { >+ if (child->isRubyText() && effectiveRubyPosition(child) == RP_AFTER) >+ return child; >+ } >+ >+ return NULL; >+ } >+ >+ // otherwise continue with the next 'AFTER' text >+ // Note: there should only be 1 such text per se, but even in well-formed HTML/CSS, the designer could >+ // have explicitely set 'ruby-position: after' for all texts (once we support ruby-position) >+ ASSERT(child->isRubyText() && effectiveRubyPosition(child) == RP_AFTER); >+ for (child = child->nextSiblingBox(); child; child = child->nextSiblingBox()) { >+ if (child->isRubyText() && effectiveRubyPosition(child) == RP_AFTER) >+ return child; >+ } >+ >+ return NULL; >+} >+ >+ERubyPosition RenderRubyRun::effectiveRubyPosition(RenderObject* child) const >+{ >+ ASSERT(child->isRubyText()); >+ // ruby-position CSS property not implemented. >+ // simply position the first <rt> in BEFORE position, the 2nd in AFTER position >+ for (RenderObject* sibling = child->previousSibling(); sibling; sibling = sibling->previousSibling()) { >+ if (sibling->isRubyText() && effectiveRubyPosition(sibling) == RP_BEFORE) >+ return RP_AFTER; >+ } >+ return RP_BEFORE; >+} >+ >+RenderRubyBase* RenderRubyRun::getRubyBase() const >+{ >+ for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { >+ if (child->isRubyBase()) >+ return static_cast<RenderRubyBase*>(child); >+ } >+ return NULL; >+} >+ >+RenderRubyText* RenderRubyRun::getFirstRubyText() const >+{ >+ for (RenderObject* child = firstChild(); child; child = child->nextSibling()) { >+ if (child->isRubyText()) >+ return static_cast<RenderRubyText*>(child); >+ } >+ return NULL; >+} >+ >+RenderRubyText* RenderRubyRun::getLastRubyText() const >+{ >+ for (RenderObject* child = lastChild(); child; child = child->previousSibling()) { >+ if (child->isRubyText()) >+ return static_cast<RenderRubyText*>(child); >+ } >+ return NULL; >+} >+ >+RenderRubyBase* RenderRubyRun::createAnonymousRubyBase() >+{ >+ RenderRubyBase* rb = new (renderArena()) RenderRubyBase(document() /* anonymous */); >+ RefPtr<RenderStyle> newStyle = RenderStyle::create(); >+ newStyle->inheritFrom(style()); >+ newStyle->setDisplay(BLOCK); >+ newStyle->setTextAlign(CENTER); // FIXME: use WEBKIT_CENTER? >+ rb->setStyle(newStyle.release()); >+ return rb; >+} >+ >+RenderRubyText* RenderRubyRun::createAnonymousRubyText() >+{ >+ RenderRubyText* rt = new (renderArena()) RenderRubyText(document() /* anonymous */); >+ RefPtr<RenderStyle> newStyle = RenderStyle::create(); >+ newStyle->inheritFrom(style()); >+ newStyle->setDisplay(BLOCK); >+ newStyle->setTextAlign(CENTER); // FIXME: temporary solution - need DISTRIBUTE_LETTERS/SPACES >+ rt->setStyle(newStyle.release()); >+ return rt; >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >+ >Index: WebCore/rendering/RenderRubyRun.h >=================================================================== >--- WebCore/rendering/RenderRubyRun.h (revision 0) >+++ WebCore/rendering/RenderRubyRun.h (revision 0) >@@ -0,0 +1,80 @@ >+/* >+ * This file is part of the WebKit project. >+ * >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ * >+ */ >+ >+#ifndef RenderRubyRun_h >+#define RenderRubyRun_h >+ >+#if ENABLE(RUBY) >+ >+#include "RenderBlock.h" >+ >+namespace WebCore { >+ >+class RenderRubyBase; >+class RenderRubyText; >+ >+// RenderRubyRun are 'inline-block/table' like objects,and wrap a single pairing of a ruby base with its ruby text(s). >+// See RenderRuby.h for further comments on the structure >+ >+class RenderRubyRun : public RenderBlock { >+public: >+ RenderRubyRun(Node*); >+ virtual ~RenderRubyRun(); >+ >+ virtual const char* renderName() const { return "RenderRubyRun (anonymous)"; } >+ >+ virtual bool isRubyRun() const { return true; } >+ virtual bool isInlineBlockOrInlineTable() const { return true; } >+ >+ bool hasRubyBase() const; >+ int numberOfRubyTexts() const; >+ >+ virtual bool isChildAllowed(RenderObject*, RenderStyle*) const; >+ virtual void addChild(RenderObject* child, RenderObject* beforeChild = 0); >+ >+ virtual int baselinePosition(bool firstLine, bool isRootLineBox = false) const; >+ >+ virtual RenderBlock* firstLineBlock() const; >+ virtual void updateFirstLetter(); >+ >+ virtual bool shouldPaintSelectionGaps() const { return false; } >+ >+ RenderRubyBase* getRubyBase() const; >+ RenderRubyText* getFirstRubyText() const; >+ RenderRubyText* getLastRubyText() const; >+ >+ ERubyPosition effectiveRubyPosition(RenderObject* child) const; >+ >+protected: >+ virtual RenderBox* firstChildBoxInLayoutOrder() const; >+ virtual RenderBox* nextChildBoxInLayoutOrder(RenderBox* childBox) const; >+ >+private: >+ RenderRubyBase* createAnonymousRubyBase(); >+ RenderRubyText* createAnonymousRubyText(); >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >+ >+#endif // RenderRubyRun_h >Index: WebCore/rendering/RenderRubyText.cpp >=================================================================== >--- WebCore/rendering/RenderRubyText.cpp (revision 0) >+++ WebCore/rendering/RenderRubyText.cpp (revision 0) >@@ -0,0 +1,45 @@ >+/* >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+#include "RenderRubyText.h" >+ >+#if ENABLE(RUBY) >+ >+namespace WebCore { >+ >+RenderRubyText::RenderRubyText(Node* node) >+ : RenderBlock(node) >+{ >+} >+ >+RenderRubyText::~RenderRubyText() >+{ >+} >+ >+bool RenderRubyText::isChildAllowed(RenderObject* child, RenderStyle*) const >+{ >+ return child->isInline(); >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >+ >+ >Index: WebCore/rendering/RenderRubyText.h >=================================================================== >--- WebCore/rendering/RenderRubyText.h (revision 0) >+++ WebCore/rendering/RenderRubyText.h (revision 0) >@@ -0,0 +1,48 @@ >+/* >+ * This file is part of the WebKit project. >+ * >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ * >+ */ >+ >+#ifndef RenderRubyText_h >+#define RenderRubyText_h >+ >+#if ENABLE(RUBY) >+ >+#include "RenderBlock.h" >+ >+namespace WebCore { >+ >+class RenderRubyText : public RenderBlock { >+public: >+ RenderRubyText(Node*); >+ virtual ~RenderRubyText(); >+ >+ virtual const char* renderName() const { return "RenderRubyText"; } >+ >+ virtual bool isRubyText() const { return true; } >+ >+ virtual bool isChildAllowed(RenderObject*, RenderStyle*) const; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >+ >+#endif // RenderRubyText_h >Index: WebCore/rendering/RenderTheme.h >=================================================================== >--- WebCore/rendering/RenderTheme.h (revision 45782) >+++ WebCore/rendering/RenderTheme.h (working copy) >@@ -78,12 +78,15 @@ public: > // RenderThemeMac.cpp for Mac OS X. > > // These methods return the theme's extra style sheets rules, to let each platform >- // adjust the default CSS rules in html.css, quirks.css, or mediaControls.css >+ // adjust the default CSS rules in html.css, quirks.css, mediaControls.css, or ruby.css > virtual String extraDefaultStyleSheet() { return String(); } > virtual String extraQuirksStyleSheet() { return String(); } > #if ENABLE(VIDEO) > virtual String extraMediaControlsStyleSheet() { return String(); }; > #endif >+#if ENABLE(RUBY) >+ virtual String extraRubyStyleSheet() { return String(); }; >+#endif > > // A method to obtain the baseline position for a "leaf" control. This will only be used if a baseline > // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of >Index: WebCore/rendering/RubyInlineFlowBox.cpp >=================================================================== >--- WebCore/rendering/RubyInlineFlowBox.cpp (revision 0) >+++ WebCore/rendering/RubyInlineFlowBox.cpp (revision 0) >@@ -0,0 +1,77 @@ >+/* >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+#include "RubyInlineFlowBox.h" >+ >+#if ENABLE(RUBY) >+ >+namespace WebCore { >+ >+using namespace std; >+ >+ >+RubyInlineFlowBox::RubyInlineFlowBox(RenderObject* obj) >+ : InlineFlowBox(obj) >+ , m_cachedHeight(0) >+ , m_cachedBaseline(0) >+{ >+ setHasVirtualHeight(); >+} >+ >+int RubyInlineFlowBox::virtualHeight() const >+{ >+ if(m_cachedHeight <= 0) >+ computeHeightAndBaseline(); >+ >+ return m_cachedHeight; >+} >+ >+int RubyInlineFlowBox::baselinePosition(bool) const >+{ >+ if(m_cachedBaseline <= 0) >+ computeHeightAndBaseline(); >+ >+ return m_cachedBaseline; >+} >+ >+void RubyInlineFlowBox::computeHeightAndBaseline() const >+{ >+ int maxAscent = 0; >+ int maxDescent = 0; >+ >+ for (InlineBox* run = firstChild(); run; run = run->nextOnLine()) { >+ int runHeight = run->height(); >+ int runBaseline = run->baselinePosition(false); >+ int y = run->y(); >+ int ascent = y + runBaseline; >+ int descent = runHeight - runBaseline; >+ maxAscent = max(maxAscent, ascent); >+ maxDescent = max(maxDescent, descent); >+ } >+ >+ m_cachedBaseline = maxAscent + borderTop() + paddingTop(); >+ m_cachedHeight = m_cachedBaseline + maxDescent + borderBottom() + paddingBottom(); >+ ASSERT(m_cachedBaseline >= 0); >+ ASSERT(m_cachedHeight >= 0); >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >Index: WebCore/rendering/RubyInlineFlowBox.h >=================================================================== >--- WebCore/rendering/RubyInlineFlowBox.h (revision 0) >+++ WebCore/rendering/RubyInlineFlowBox.h (revision 0) >@@ -0,0 +1,54 @@ >+/* >+ * This file is part of the WebKit project. >+ * >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ * >+ */ >+ >+#ifndef RubyInlineFlowBox_h >+#define RubyInlineFlowBox_h >+ >+#if ENABLE(RUBY) >+ >+#include "InlineFlowBox.h" >+ >+namespace WebCore { >+ >+class RubyInlineFlowBox : public InlineFlowBox { >+public: >+ RubyInlineFlowBox(RenderObject* obj); >+ >+ virtual bool isRuby() const { return true; } >+ >+ virtual int virtualHeight() const; >+ virtual int baselinePosition(bool /*isRootLineBox*/) const; >+ virtual int lineHeight(bool /*isRootLineBox*/) const { return height(); } >+ >+protected: >+ void computeHeightAndBaseline() const; // operates on mutable members only >+ >+private: >+ mutable int m_cachedHeight; >+ mutable int m_cachedBaseline; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >+ >+#endif // RubyInlineFlowBox_h >Index: WebCore/rendering/RubyRootInlineBox.cpp >=================================================================== >--- WebCore/rendering/RubyRootInlineBox.cpp (revision 0) >+++ WebCore/rendering/RubyRootInlineBox.cpp (revision 0) >@@ -0,0 +1,34 @@ >+/* >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ */ >+ >+#include "config.h" >+#include "RubyRootInlineBox.h" >+ >+#if ENABLE(RUBY) >+ >+namespace WebCore { >+ >+RubyRootInlineBox::RubyRootInlineBox(RenderObject* obj) >+ : RootInlineBox(obj) >+{ >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >Index: WebCore/rendering/RubyRootInlineBox.h >=================================================================== >--- WebCore/rendering/RubyRootInlineBox.h (revision 0) >+++ WebCore/rendering/RubyRootInlineBox.h (revision 0) >@@ -0,0 +1,43 @@ >+/* >+ * This file is part of the WebKit project. >+ * >+ * Copyright (C) 2009 Google Inc. All rights reserved. >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Library General Public >+ * License as published by the Free Software Foundation; either >+ * version 2 of the License, or (at your option) any later version. >+ * >+ * This library is distributed in the hope that it will be useful, >+ * but WITHOUT ANY WARRANTY; without even the implied warranty of >+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >+ * Library General Public License for more details. >+ * >+ * You should have received a copy of the GNU Library General Public License >+ * along with this library; see the file COPYING.LIB. If not, write to >+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >+ * Boston, MA 02110-1301, USA. >+ * >+ */ >+ >+#ifndef RubyRootInlineBox_h >+#define RubyRootInlineBox_h >+ >+#if ENABLE(RUBY) >+ >+#include "RootInlineBox.h" >+ >+namespace WebCore { >+ >+class RubyRootInlineBox : public RootInlineBox { >+public: >+ RubyRootInlineBox(RenderObject* obj); >+ >+ virtual bool isRuby() const { return true; } >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(RUBY) >+ >+#endif // RubyRootInlineBox_h >Index: WebCore/rendering/style/RenderStyleConstants.h >=================================================================== >--- WebCore/rendering/style/RenderStyleConstants.h (revision 45782) >+++ WebCore/rendering/style/RenderStyleConstants.h (working copy) >@@ -304,6 +304,15 @@ enum ETransformStyle3D { > enum EBackfaceVisibility { > BackfaceVisibilityVisible, BackfaceVisibilityHidden > }; >+ >+#if ENABLE(RUBY) >+enum ERubyPosition { >+// RP_AUTO, // <- see http://www.w3.org/Style/CSS/Tracker/issues/107 >+ RP_BEFORE, >+ RP_AFTER, >+// RP_RIGHT >+}; >+#endif > > } // namespace WebCore > >Index: WebKit/mac/ChangeLog >=================================================================== >--- WebKit/mac/ChangeLog (revision 45795) >+++ WebKit/mac/ChangeLog (working copy) >@@ -1,3 +1,11 @@ >+2009-07-13 Roland Steiner <rolandsteiner@google.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added flag ENABLE_RUBY to enable/disable HTML5 ruby support. >+ >+ * Configurations/FeatureDefines.xcconfig: >+ > 2009-07-13 Drew Wilson <atwilson@google.com> > > Reviewed by David Levin. >Index: WebKit/mac/Configurations/FeatureDefines.xcconfig >=================================================================== >--- WebKit/mac/Configurations/FeatureDefines.xcconfig (revision 45782) >+++ WebKit/mac/Configurations/FeatureDefines.xcconfig (working copy) >@@ -40,6 +40,7 @@ ENABLE_GEOLOCATION = ; > ENABLE_ICONDATABASE = ENABLE_ICONDATABASE; > ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER; > ENABLE_OFFLINE_WEB_APPLICATIONS = ENABLE_OFFLINE_WEB_APPLICATIONS; >+ENABLE_RUBY = ENABLE_RUBY; > ENABLE_SVG = ENABLE_SVG; > ENABLE_SVG_ANIMATION = ENABLE_SVG_ANIMATION; > ENABLE_SVG_AS_IMAGE = ENABLE_SVG_AS_IMAGE; >@@ -53,4 +54,4 @@ ENABLE_WORKERS = ENABLE_WORKERS; > ENABLE_XPATH = ENABLE_XPATH; > ENABLE_XSLT = ENABLE_XSLT; > >-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DOM_STORAGE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT); >+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DOM_STORAGE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_RUBY) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XPATH) $(ENABLE_XSLT); >Index: WebKit/win/ChangeLog >=================================================================== >--- WebKit/win/ChangeLog (revision 45795) >+++ WebKit/win/ChangeLog (working copy) >@@ -1,3 +1,11 @@ >+2009-07-13 Roland Steiner <rolandsteiner@google.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added new files for HTML5 ruby support to project file. >+ >+ * WebKit.vcproj/WebKit.vcproj: >+ > 2009-07-12 Brent Fulgham <bfulgham@gmail.com> > > Speculative Windows build fix after http://trac.webkit.org/changeset/45786. >Index: WebKit/win/WebKit.vcproj/WebKit.vcproj >=================================================================== >--- WebKit/win/WebKit.vcproj/WebKit.vcproj (revision 45782) >+++ WebKit/win/WebKit.vcproj/WebKit.vcproj (working copy) >@@ -40,7 +40,7 @@ > <Tool > Name="VCCLCompilerTool" > AdditionalIncludeDirectories=""$(WebKitOutputDir)\include\WebKit";"$(WebKitOutputDir)\Include";"$(WebKitLibrariesDir)\Include";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\icu";"$(WebKitLibrariesDir)\Include\icu";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(ProjectDir)\..";"$(ProjectDir)";"$(ProjectDir)\..\WebCoreSupport";"$(IntDir)\include";"$(WebKitOutputDir)\obj\WebKit\DerivedSources"" >- PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;ENABLE_CHANNEL_MESSAGING;ENABLE_DATABASE;ENABLE_DATAGRID;ENABLE_DOM_STORAGE;ENABLE_ICONDATABASE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_FONTS;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_USE;ENABLE_VIDEO;ENABLE_WORKERS;ENABLE_XPATH;ENABLE_XSLT" >+ PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;ENABLE_CHANNEL_MESSAGING;ENABLE_DATABASE;ENABLE_DATAGRID;ENABLE_DOM_STORAGE;ENABLE_ICONDATABASE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_RUBY;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_FONTS;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_USE;ENABLE_VIDEO;ENABLE_WORKERS;ENABLE_XPATH;ENABLE_XSLT" > UsePrecompiledHeader="2" > PrecompiledHeaderThrough="WebKitPrefix.h" > ForcedIncludeFiles="WebKitPrefix.h" >@@ -116,7 +116,7 @@ > <Tool > Name="VCCLCompilerTool" > AdditionalIncludeDirectories=""$(WebKitOutputDir)\include\WebKit";"$(WebKitOutputDir)\Include";"$(WebKitLibrariesDir)\Include";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\icu";"$(WebKitLibrariesDir)\Include\icu";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(ProjectDir)\..";"$(ProjectDir)";"$(ProjectDir)\..\WebCoreSupport";"$(IntDir)\include";"$(WebKitOutputDir)\obj\WebKit\DerivedSources"" >- PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;ENABLE_CHANNEL_MESSAGING;ENABLE_DATABASE;ENABLE_DATAGRID;ENABLE_DOM_STORAGE;ENABLE_ICONDATABASE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_FONTS;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_USE;ENABLE_VIDEO;ENABLE_WORKERS;ENABLE_XPATH;ENABLE_XSLT" >+ PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;ENABLE_CHANNEL_MESSAGING;ENABLE_DATABASE;ENABLE_DATAGRID;ENABLE_DOM_STORAGE;ENABLE_ICONDATABASE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_RUBY;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_FONTS;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_USE;ENABLE_VIDEO;ENABLE_WORKERS;ENABLE_XPATH;ENABLE_XSLT" > UsePrecompiledHeader="2" > PrecompiledHeaderThrough="WebKitPrefix.h" > ForcedIncludeFiles="WebKitPrefix.h" >@@ -191,7 +191,7 @@ > <Tool > Name="VCCLCompilerTool" > AdditionalIncludeDirectories=""$(WebKitOutputDir)\include\WebKit";"$(WebKitOutputDir)\Include";"$(WebKitLibrariesDir)\Include";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\icu";"$(WebKitLibrariesDir)\Include\icu";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(ProjectDir)\..";"$(ProjectDir)";"$(ProjectDir)\..\WebCoreSupport";"$(IntDir)\include";"$(WebKitOutputDir)\obj\WebKit\DerivedSources"" >- PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;ENABLE_CHANNEL_MESSAGING;ENABLE_DATABASE;ENABLE_DATAGRID;ENABLE_DOM_STORAGE;ENABLE_ICONDATABASE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_FONTS;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_USE;ENABLE_VIDEO;ENABLE_WORKERS;ENABLE_XPATH;ENABLE_XSLT" >+ PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;ENABLE_CHANNEL_MESSAGING;ENABLE_DATABASE;ENABLE_DATAGRID;ENABLE_DOM_STORAGE;ENABLE_ICONDATABASE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_RUBY;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_FONTS;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_USE;ENABLE_VIDEO;ENABLE_WORKERS;ENABLE_XPATH;ENABLE_XSLT" > UsePrecompiledHeader="2" > PrecompiledHeaderThrough="WebKitPrefix.h" > Detect64BitPortabilityProblems="false" >@@ -269,7 +269,7 @@ > <Tool > Name="VCCLCompilerTool" > AdditionalIncludeDirectories=""$(WebKitOutputDir)\include\WebKit";"$(WebKitOutputDir)\Include";"$(WebKitLibrariesDir)\Include";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\icu";"$(WebKitLibrariesDir)\Include\icu";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(ProjectDir)\..";"$(ProjectDir)";"$(ProjectDir)\..\WebCoreSupport";"$(IntDir)\include";"$(WebKitOutputDir)\obj\WebKit\DerivedSources"" >- PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;ENABLE_CHANNEL_MESSAGING;ENABLE_DATABASE;ENABLE_DATAGRID;ENABLE_DOM_STORAGE;ENABLE_ICONDATABASE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_FONTS;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_USE;ENABLE_WORKERS;ENABLE_XPATH;ENABLE_XSLT" >+ PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;ENABLE_CHANNEL_MESSAGING;ENABLE_DATABASE;ENABLE_DATAGRID;ENABLE_DOM_STORAGE;ENABLE_ICONDATABASE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_RUBY;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_FONTS;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_USE;ENABLE_WORKERS;ENABLE_XPATH;ENABLE_XSLT" > UsePrecompiledHeader="2" > PrecompiledHeaderThrough="WebKitPrefix.h" > ForcedIncludeFiles="WebKitPrefix.h" >@@ -348,7 +348,7 @@ > <Tool > Name="VCCLCompilerTool" > AdditionalIncludeDirectories=""$(WebKitOutputDir)\include\WebKit";"$(WebKitOutputDir)\Include";"$(WebKitLibrariesDir)\Include";"$(WebKitOutputDir)\Include\WebCore";"$(WebKitLibrariesDir)\Include\WebCore";"$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders";"$(WebKitOutputDir)\Include\JavaScriptCore";"$(WebKitLibrariesDir)\Include\JavaScriptCore";"$(WebKitOutputDir)\Include\icu";"$(WebKitLibrariesDir)\Include\icu";"$(WebKitLibrariesDir)\include\pthreads";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders";"$(WebKitOutputDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(WebKitLibrariesDir)\Include\CoreFoundation\OSXCompatibilityHeaders\GNUCompatibility";"$(ProjectDir)\..";"$(ProjectDir)";"$(ProjectDir)\..\WebCoreSupport";"$(IntDir)\include";"$(WebKitOutputDir)\obj\WebKit\DerivedSources"" >- PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;ENABLE_CHANNEL_MESSAGING;ENABLE_DATABASE;ENABLE_DATAGRID;ENABLE_DOM_STORAGE;ENABLE_ICONDATABASE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_FONTS;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_USE;ENABLE_WORKERS;ENABLE_XPATH;ENABLE_XSLT" >+ PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;ENABLE_CHANNEL_MESSAGING;ENABLE_DATABASE;ENABLE_DATAGRID;ENABLE_DOM_STORAGE;ENABLE_ICONDATABASE;ENABLE_OFFLINE_WEB_APPLICATIONS;ENABLE_RUBY;ENABLE_SVG;ENABLE_SVG_ANIMATION;ENABLE_SVG_AS_IMAGE;ENABLE_SVG_FONTS;ENABLE_SVG_FOREIGN_OBJECT;ENABLE_SVG_USE;ENABLE_WORKERS;ENABLE_XPATH;ENABLE_XSLT" > UsePrecompiledHeader="2" > PrecompiledHeaderThrough="WebKitPrefix.h" > ForcedIncludeFiles="WebKitPrefix.h" >Index: WebKitTools/ChangeLog >=================================================================== >--- WebKitTools/ChangeLog (revision 45795) >+++ WebKitTools/ChangeLog (working copy) >@@ -1,3 +1,12 @@ >+2009-07-13 Roland Steiner <rolandsteiner@google.com> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Added flag ENABLE_RUBY to enable/disable HTML5 ruby support. >+ Added additional ruby.css style sheet ONLY if ruby support is enabled. >+ >+ * Scripts/build-webkit: >+ > 2009-07-13 Drew Wilson <atwilson@google.com> > > Reviewed by David Levin. >Index: WebKitTools/Scripts/build-webkit >=================================================================== >--- WebKitTools/Scripts/build-webkit (revision 45782) >+++ WebKitTools/Scripts/build-webkit (working copy) >@@ -46,10 +46,10 @@ my $makeArgs; > > my ($threeDRenderingSupport, $channelMessagingSupport, $databaseSupport, $domStorageSupport, > $filtersSupport, $geolocationSupport, $gnomeKeyringSupport, $iconDatabaseSupport, >- $javaScriptDebuggerSupport, $offlineWebApplicationSupport, $svgSupport, $svgAnimationSupport, >- $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport, $svgForeignObjectSupport, >- $svgUseSupport, $videoSupport, $wmlSupport, $workersSupport, $xpathSupport, $xsltSupport, >- $coverageSupport); >+ $javaScriptDebuggerSupport, $offlineWebApplicationSupport, $rubySupport, $svgSupport, >+ $svgAnimationSupport, $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport, >+ $svgForeignObjectSupport, $svgUseSupport, $videoSupport, $wmlSupport, $workersSupport, >+ $xpathSupport, $xsltSupport, $coverageSupport); > > my @features = ( > { option => "3d-rendering", desc => "Toggle 3D rendering support", >@@ -85,6 +85,9 @@ my @features = ( > { option => "offline-web-applications", desc => "Toggle Offline Web Application Support", > define => "ENABLE_OFFLINE_WEB_APPLICATIONS", default => 1, value => \$offlineWebApplicationSupport }, > >+ { option => "ruby", desc => "Toggle HTML5 Ruby support", >+ define => "ENABLE_RUBY", default => 1, value => \$rubySupport }, >+ > { option => "svg", desc => "Toggle SVG support", > define => "ENABLE_SVG", default => 1, value => \$svgSupport }, >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 3749
:
2690
|
3285
|
10658
|
31843
|
32654
|
32655
|
32823
|
34043
|
34045
|
35011
|
35012
|
41482