summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/core/html/HTMLRubyElement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/core/html/HTMLRubyElement.cpp')
-rw-r--r--chromium/third_party/WebKit/Source/core/html/HTMLRubyElement.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/chromium/third_party/WebKit/Source/core/html/HTMLRubyElement.cpp b/chromium/third_party/WebKit/Source/core/html/HTMLRubyElement.cpp
new file mode 100644
index 00000000000..ab6febd1ecc
--- /dev/null
+++ b/chromium/third_party/WebKit/Source/core/html/HTMLRubyElement.cpp
@@ -0,0 +1,31 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/html/HTMLRubyElement.h"
+
+#include "core/HTMLNames.h"
+#include "core/rendering/RenderRuby.h"
+
+namespace WebCore {
+
+using namespace HTMLNames;
+
+inline HTMLRubyElement::HTMLRubyElement(Document& document)
+ : HTMLElement(rubyTag, document)
+{
+}
+
+DEFINE_NODE_FACTORY(HTMLRubyElement)
+
+RenderObject* HTMLRubyElement::createRenderer(RenderStyle* style)
+{
+ if (style->display() == INLINE)
+ return new RenderRubyAsInline(this);
+ if (style->display() == BLOCK)
+ return new RenderRubyAsBlock(this);
+ return RenderObject::createObject(this, style);
+}
+
+}