LayoutTests/ChangeLog

 12011-02-10 Carol Szabo <carol.szabo@nokia.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 content property doesn't support quotes
 6 https://bugs.webkit.org/show_bug.cgi?id=6503
 7
 8 Added new tests for quotes.
 9
 10 * fast/css/content/content-quotes-01-expected.txt: Added.
 11 * fast/css/content/content-quotes-01.html: Added.
 12 * fast/css/content/content-quotes-02-expected.txt: Added.
 13 * fast/css/content/content-quotes-02.html: Added.
 14 * fast/css/content/content-quotes-03-expected.txt: Added.
 15 * fast/css/content/content-quotes-03.html: Added.
 16 * fast/css/content/content-quotes-04-expected.txt: Added.
 17 * fast/css/content/content-quotes-04.html: Added.
 18 * fast/css/content/content-quotes-05-expected.txt: Added.
 19 * fast/css/content/content-quotes-05.html: Added.
 20
1212011-02-10 Philippe Normand <pnormand@igalia.com>
222
323 Unreviewed skip failing fast/text/international/hindi-whitespace.html test on GTK

LayoutTests/fast/css/content/content-quotes-01-expected.txt

 1The texts between the markers should be identical.
 2
 3========Marker1========
 4
 5ab 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 6========Marker2========
 7
 8WWaWWbWWWWWWWW 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 9========Marker3========
 10
 11PASSED

LayoutTests/fast/css/content/content-quotes-01.html

 1<html>
 2 <head>
 3 <style type="text/css">
 4 body { quotes: "WW" "WWWW"; }
 5 </style>
 6 <script type="text/javascript">
 7 if (window.layoutTestController) {
 8 layoutTestController.dumpAsText();
 9 layoutTestController.waitUntilDone();
 10 }
 11
 12 function run() {
 13 testWidth = window.getComputedStyle(document.getElementById("testContainer"), null).getPropertyValue("width");
 14 referenceWidth = window.getComputedStyle(document.getElementById("reference"), null).getPropertyValue("width");
 15 if (testWidth == referenceWidth)
 16 document.getElementById("console").innerText = "PASSED";
 17 else
 18 document.getElementById("console").innerText = "FAILED: testWidth=" + testWidth +"; expected " + referenceWidth;
 19 if (window.layoutTestController)
 20 layoutTestController.notifyDone();
 21 }
 22 </script>
 23 </head>
 24
 25 <body onload="setTimeout('run()', 0);">
 26 <p id="onlyInBrowser">The texts between the markers should be identical.</p>
 27 <p>========Marker1========</p>
 28 <table>
 29 <tr>
 30 <td id="testContainer"><q>a<q>b</q></q></td>
 31 <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
 32 </tr>
 33 </table>
 34 <p>========Marker2========</p>
 35 <table>
 36 <tr>
 37 <td id="reference">WWaWWbWWWWWWWW</td>
 38 <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
 39 </tr>
 40 </table>
 41 <p>========Marker3========</p>
 42 <pre id="console"/>
 43 </body>
 44</html>

LayoutTests/fast/css/content/content-quotes-02-expected.txt

 1========Marker1========
 2
 3abcd 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 4========Marker2========
 5
 6aWWWbWWWWWcWWdWWWW 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 7========Marker3========
 8
 9PASSED

LayoutTests/fast/css/content/content-quotes-02.html

 1<html>
 2 <head>
 3 <style type="text/css">
 4 body { quotes: "WW" "WWWW" "WWW" "WWWWW"; }
 5 span:before { content: no-open-quote; }
 6 span:after { content: no-close-quote; }
 7 </style>
 8 <script type="text/javascript">
 9 if (window.layoutTestController) {
 10 layoutTestController.dumpAsText();
 11 layoutTestController.waitUntilDone();
 12 }
 13
 14 function run() {
 15 if (window.layoutTestController)
 16 document.getElementById("onlyInBrowser").setAttribute("style", "display: none;");
 17 testWidth = window.getComputedStyle(document.getElementById("testContainer"), null).getPropertyValue("width");
 18 referenceWidth = window.getComputedStyle(document.getElementById("reference"), null).getPropertyValue("width");
 19 if (testWidth == referenceWidth)
 20 document.getElementById("console").innerText = "PASSED";
 21 else
 22 document.getElementById("console").innerText = "FAILED: testWidth=" + testWidth +"; expected " + referenceWidth;
 23 document.getElementById("onlyInBrowser").setAttribute("style", "display: none;");
 24 if (window.layoutTestController)
 25 layoutTestController.notifyDone();
 26 }
 27 </script>
 28 </head>
 29
 30 <body onload="setTimeout('run()', 0);">
 31 <p id="onlyInBrowser">The texts between the markers should be identical.</p>
 32 <p>========Marker1========</p>
 33 <table>
 34 <tr>
 35 <td id="testContainer"><span>a<q>b</q>c</span><q>d</q></td>
 36 <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
 37 </tr>
 38 </table>
 39 <p>========Marker2========</p>
 40 <table>
 41 <tr>
 42 <td id="reference">aWWWbWWWWWcWWdWWWW</td>
 43 <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
 44 </tr>
 45 </table>
 46 <p>========Marker3========</p>
 47 <pre id="console"/>
 48 </body>
 49</html>

LayoutTests/fast/css/content/content-quotes-03-expected.txt

 1========Marker1========
 2
 3ab 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 4========Marker2========
 5
 6aWWWbWWWWW 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 7========Marker3========
 8
 9PASSED

LayoutTests/fast/css/content/content-quotes-03.html

 1<html>
 2 <head>
 3 <style type="text/css">
 4 body { quotes: "WW" "WWWW" "WWW" "WWWWW"; }
 5 b:before { content: no-open-quote; }
 6 </style>
 7 <script type="text/javascript">
 8 if (window.layoutTestController) {
 9 layoutTestController.dumpAsText();
 10 layoutTestController.waitUntilDone();
 11 }
 12
 13 function run() {
 14 if (window.layoutTestController)
 15 document.getElementById("onlyInBrowser").setAttribute("style", "display: none;");
 16 testWidth = window.getComputedStyle(document.getElementById("testContainer"), null).getPropertyValue("width");
 17 referenceWidth = window.getComputedStyle(document.getElementById("reference"), null).getPropertyValue("width");
 18 if (testWidth == referenceWidth)
 19 document.getElementById("console").innerText = "PASSED";
 20 else
 21 document.getElementById("console").innerText = "FAILED: testWidth=" + testWidth +"; expected " + referenceWidth;
 22 if (window.layoutTestController)
 23 layoutTestController.notifyDone();
 24 }
 25 </script>
 26 </head>
 27
 28 <body onload="setTimeout('run()', 0);">
 29 <p id="onlyInBrowser">The texts between the markers should be identical.</p>
 30 <p>========Marker1========</p>
 31 <table>
 32 <tr>
 33 <td id="testContainer"><span><b>a</b></span><q>b</q></td>
 34 <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
 35 </tr>
 36 </table>
 37 <p>========Marker2========</p>
 38 <table>
 39 <tr>
 40 <td id="reference"><span style="font-weight: bolder;">a</span>WWWbWWWWW</td>
 41 <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
 42 </tr>
 43 </table>
 44 <p>========Marker3========</p>
 45 <pre id="console"/>
 46 </body>
 47</html>

LayoutTests/fast/css/content/content-quotes-04-expected.txt

 1========Marker1========
 2
 3b 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 4========Marker2========
 5
 6WWbWWWW 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 7========Marker3========
 8
 9PASSED

LayoutTests/fast/css/content/content-quotes-04.html

 1<html>
 2 <head>
 3 <style type="text/css">
 4 body { quotes: "WW" "WWWW" "WWW" "WWWWW"; }
 5 b:before { content: no-open-quote; }
 6 </style>
 7 <script type="text/javascript">
 8 if (window.layoutTestController) {
 9 layoutTestController.dumpAsText();
 10 layoutTestController.waitUntilDone();
 11 }
 12
 13 function run() {
 14 if (window.layoutTestController)
 15 document.getElementById("onlyInBrowser").setAttribute("style", "display: none;");
 16 el = document.getElementById("toRemove");
 17 el.parentNode.removeChild(el);
 18 testWidth = window.getComputedStyle(document.getElementById("testContainer"), null).getPropertyValue("width");
 19 referenceWidth = window.getComputedStyle(document.getElementById("reference"), null).getPropertyValue("width");
 20 if (testWidth == referenceWidth)
 21 document.getElementById("console").innerText = "PASSED";
 22 else
 23 document.getElementById("console").innerText = "FAILED: testWidth=" + testWidth +"; expected " + referenceWidth;
 24 if (window.layoutTestController)
 25 layoutTestController.notifyDone();
 26 }
 27 </script>
 28 </head>
 29
 30 <body onload="setTimeout('run()', 0);">
 31 <p id="onlyInBrowser">The texts between the markers should be identical.</p>
 32 <p>========Marker1========</p>
 33 <table>
 34 <tr>
 35 <td id="testContainer"><span><b id="toRemove">a</b></span><q>b</q></td>
 36 <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
 37 </tr>
 38 </table>
 39 <p>========Marker2========</p>
 40 <table>
 41 <tr>
 42 <td id="reference">WWbWWWW</td>
 43 <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
 44 </tr>
 45 </table>
 46 <p>========Marker3========</p>
 47 <pre id="console"/>
 48 </body>
 49</html>

LayoutTests/fast/css/content/content-quotes-05-expected.txt

 1========Marker1========
 2
 3abc 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 4========Marker2========
 5
 6WWaWWWbWWWWWcWWWW 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
 7========Marker3========
 8
 9PASSED

LayoutTests/fast/css/content/content-quotes-05.html

 1<html>
 2 <head>
 3 <style type="text/css">
 4 .myQuotes { quotes: "WW" "WWWW" "WWW" "WWWWW"; }
 5 </style>
 6 <script type="text/javascript">
 7 if (window.layoutTestController) {
 8 layoutTestController.dumpAsText();
 9 layoutTestController.waitUntilDone();
 10 }
 11
 12 function run() {
 13 if (window.layoutTestController)
 14 document.getElementById("onlyInBrowser").setAttribute("style", "display: none;");
 15 document.body.setAttribute("class", "myQuotes");
 16 testWidth = window.getComputedStyle(document.getElementById("testContainer"), null).getPropertyValue("width");
 17 referenceWidth = window.getComputedStyle(document.getElementById("reference"), null).getPropertyValue("width");
 18 if (testWidth == referenceWidth)
 19 document.getElementById("console").innerText = "PASSED";
 20 else
 21 document.getElementById("console").innerText = "FAILED: testWidth=" + testWidth +"; expected " + referenceWidth;
 22 if (window.layoutTestController)
 23 layoutTestController.notifyDone();
 24 }
 25 </script>
 26 </head>
 27
 28 <body onload="setTimeout('run()', 0);">
 29 <p id="onlyInBrowser">The texts between the markers should be identical.</p>
 30 <p>========Marker1========</p>
 31 <table>
 32 <tr>
 33 <td id="testContainer"><q>a<q>b</q>c</q></td>
 34 <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
 35 </tr>
 36 </table>
 37 <p>========Marker2========</p>
 38 <table>
 39 <tr>
 40 <td id="reference">WWaWWWbWWWWWcWWWW</td>
 41 <td>1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</td>
 42 </tr>
 43 </table>
 44 <p>========Marker3========</p>
 45 <pre id="console"/>
 46 </body>
 47</html>

Source/WebCore/Android.mk

@@LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
701701 rendering/RenderObject.cpp \
702702 rendering/RenderObjectChildList.cpp \
703703 rendering/RenderPart.cpp \
 704 rendering/RenderQuote.cpp \
704705 rendering/RenderReplaced.cpp \
705706 rendering/RenderReplica.cpp \
706707

@@LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
791792 rendering/style/FillLayer.cpp \
792793 rendering/style/KeyframeList.cpp \
793794 rendering/style/NinePieceImage.cpp \
 795 rendering/style/QuotesData.cpp \
794796 rendering/style/RenderStyle.cpp \
795797
796798ifeq ($(ENABLE_SVG), true)

Source/WebCore/CMakeLists.txt

@@SET(WebCore_SOURCES
13671367 rendering/RenderObjectChildList.cpp
13681368 rendering/RenderPart.cpp
13691369 rendering/RenderProgress.cpp
 1370 rendering/RenderQuote.cpp
13701371 rendering/RenderReplaced.cpp
13711372 rendering/RenderReplica.cpp
13721373 rendering/RenderRuby.cpp

@@SET(WebCore_SOURCES
14051406 rendering/style/FillLayer.cpp
14061407 rendering/style/KeyframeList.cpp
14071408 rendering/style/NinePieceImage.cpp
 1409 rendering/style/QuotesData.cpp
14081410 rendering/style/RenderStyle.cpp
14091411 rendering/style/ShadowData.cpp
14101412 rendering/style/StyleBackgroundData.cpp

Source/WebCore/ChangeLog

 12011-02-11 Carol Szabo <carol.szabo@nokia.com>
 2
 3 Reviewed by NOBODY (OOPS!).
 4
 5 content property doesn't support quotes
 6 https://bugs.webkit.org/show_bug.cgi?id=6503
 7
 8 Added full support for quotes as defined by CSS 2.1.
 9
 10 Tests: fast/css/content/content-quotes-01.html
 11 fast/css/content/content-quotes-02.html
 12 fast/css/content/content-quotes-03.html
 13 fast/css/content/content-quotes-04.html
 14 fast/css/content/content-quotes-05.html
 15
 16 * Android.mk:
 17 * CMakeLists.txt:
 18 * GNUmakefile.am:
 19 * WebCore.pro:
 20 * WebCore.vcproj/WebCore.vcproj:
 21 * WebCore.xcodeproj/project.pbxproj:
 22 Added RenderQuote.cpp/h and QuotesData.cpp/h to the dependency lists
 23 * css/CSSParser.cpp:
 24 (WebCore::CSSParser::parseValue):
 25 (WebCore::CSSParser::parseQuotes):
 26 * css/CSSParser.h:
 27 Added needed stylesheet parsing support for quotes,
 28 (no-)open-quote and (no-)close-quote
 29 * css/CSSStyleSelector.cpp:
 30 (WebCore::CSSStyleSelector::applyProperty):
 31 Handled setting of the new quotes RenderStyle property and added
 32 handling of quotes for the content property.
 33 * css/html.css:
 34 (q:before):
 35 (q:after):
 36 replaced the '"' workaround with open/close-quote
 37 * rendering/RenderBlockLineLayout.cpp:
 38 (WebCore::dirtyLineBoxesForRenderer):
 39 Made RenderQuote behave like RenderCounter.
 40 Needed to ensure that the Quote text is calculated before layout,
 41 just as it is for RenderCounter.
 42 * rendering/RenderObject.h:
 43 (WebCore::RenderObject::isQuote):
 44 * rendering/RenderObjectChildList.cpp:
 45 (WebCore::RenderObjectChildList::removeChildNode):
 46 (WebCore::RenderObjectChildList::appendChildNode):
 47 (WebCore::RenderObjectChildList::insertChildNode):
 48 Handled updating of quote depth when renderers are added and removed
 49 from the tree.
 50 (WebCore::RenderObjectChildList::updateBeforeAfterContent):
 51 * rendering/RenderQuote.cpp: Added.
 52 (WebCore::adjustDepth):
 53 (WebCore::RenderQuote::RenderQuote):
 54 (WebCore::RenderQuote::~RenderQuote):
 55 (WebCore::RenderQuote::renderName):
 56 (WebCore::RenderQuote::placeQuote):
 57 (WebCore::RenderQuote::originalText):
 58 (WebCore::RenderQuote::computePreferredLogicalWidths):
 59 (WebCore::RenderQuote::rendererSubtreeAttached):
 60 (WebCore::RenderQuote::rendererRemovedFromTree):
 61 (WebCore::RenderQuote::styleDidChange):
 62 * rendering/RenderQuote.h: Added.
 63 (WebCore::RenderQuote::isQuote):
 64 (WebCore::toRenderQuote):
 65 * rendering/RenderingAllInOne.cpp:
 66 Included RenderQuote.cpp
 67 * rendering/style/ContentData.cpp:
 68 (WebCore::ContentData::dataEquivalent):
 69 Checked for quotetype identity.
 70 (WebCore::ContentData::deleteContent):
 71 Accounted for the new QUOTE_TYPE.
 72 * rendering/style/ContentData.h:
 73 (WebCore::ContentData::isQuote):
 74 (WebCore::ContentData::quote):
 75 (WebCore::ContentData::setQuote):
 76 * rendering/style/RenderStyle.cpp:
 77 (WebCore::RenderStyle::setContent):
 78 * rendering/style/RenderStyle.h:
 79 (WebCore::InheritedFlags::quotes):
 80 (WebCore::InheritedFlags::setQuotes):
 81 * rendering/style/RenderStyleConstants.h:
 82 * rendering/style/StyleRareInheritedData.cpp:
 83 (WebCore::StyleRareInheritedData::operator==):
 84 Included quotes in equality check.
 85 * rendering/style/StyleRareInheritedData.h:
 86 Added quotes
 87
1882011-02-10 Andras Becsi <abecsi@webkit.org>
289
390 Rubber-stamped by Csaba Osztrogonác.

Source/WebCore/GNUmakefile.am

@@webcore_sources += \
28202820 Source/WebCore/rendering/RenderPart.h \
28212821 Source/WebCore/rendering/RenderProgress.cpp \
28222822 Source/WebCore/rendering/RenderProgress.h \
 2823 Source/WebCore/rendering/RenderQuote.cpp \
 2824 Source/WebCore/rendering/RenderQuote.h \
28232825 Source/WebCore/rendering/RenderReplaced.cpp \
28242826 Source/WebCore/rendering/RenderReplaced.h \
28252827 Source/WebCore/rendering/RenderReplica.cpp \

@@webcore_sources += \
29222924 Source/WebCore/rendering/style/NinePieceImage.cpp \
29232925 Source/WebCore/rendering/style/NinePieceImage.h \
29242926 Source/WebCore/rendering/style/OutlineValue.h \
 2927 Source/WebCore/rendering/style/QuotesData.cpp \
 2928 Source/WebCore/rendering/style/QuotesData.h \
29252929 Source/WebCore/rendering/style/RenderStyleConstants.h \
29262930 Source/WebCore/rendering/style/RenderStyle.cpp \
29272931 Source/WebCore/rendering/style/RenderStyle.h \

Source/WebCore/WebCore.gypi

36543654 'rendering/style/NinePieceImage.cpp',
36553655 'rendering/style/NinePieceImage.h',
36563656 'rendering/style/OutlineValue.h',
 3657 'rendering/style/QuotesData.cpp',
 3658 'rendering/style/QuotesData.h',
36573659 'rendering/style/RenderStyle.cpp',
36583660 'rendering/style/RenderStyle.h',
36593661 'rendering/style/RenderStyleConstants.h',

39093911 'rendering/RenderPart.h',
39103912 'rendering/RenderProgress.cpp',
39113913 'rendering/RenderProgress.h',
 3914 'rendering/RenderQuote.cpp',
 3915 'rendering/RenderQuote.h',
39123916 'rendering/RenderReplaced.cpp',
39133917 'rendering/RenderReplaced.h',
39143918 'rendering/RenderReplica.cpp',

Source/WebCore/WebCore.pro

@@SOURCES += \
13451345 rendering/RenderObjectChildList.cpp \
13461346 rendering/RenderPart.cpp \
13471347 rendering/RenderProgress.cpp \
 1348 rendering/RenderQuote.cpp \
13481349 rendering/RenderReplaced.cpp \
13491350 rendering/RenderReplica.cpp \
13501351 rendering/RenderRuby.cpp \

@@SOURCES += \
13811382 rendering/style/FillLayer.cpp \
13821383 rendering/style/KeyframeList.cpp \
13831384 rendering/style/NinePieceImage.cpp \
 1385 rendering/style/QuotesData.cpp \
13841386 rendering/style/RenderStyle.cpp \
13851387 rendering/style/ShadowData.cpp \
13861388 rendering/style/StyleBackgroundData.cpp \

@@HEADERS += \
23202322 rendering/RenderObject.h \
23212323 rendering/RenderPart.h \
23222324 rendering/RenderProgress.h \
 2325 rendering/RenderQuote.h \
23232326 rendering/RenderReplaced.h \
23242327 rendering/RenderReplica.h \
23252328 rendering/RenderRuby.h \

@@HEADERS += \
23572360 rendering/style/FillLayer.h \
23582361 rendering/style/KeyframeList.h \
23592362 rendering/style/NinePieceImage.h \
 2363 rendering/style/QuotesData.h \
23602364 rendering/style/RenderStyle.h \
23612365 rendering/style/ShadowData.h \
23622366 rendering/style/StyleBackgroundData.h \

Source/WebCore/WebCore.vcproj/WebCore.vcproj

3507835078 >
3507935079 </File>
3508035080 <File
 35081 RelativePath="..\rendering\RenderQuote.cpp"
 35082 >
 35083 <FileConfiguration
 35084 Name="Debug|Win32"
 35085 ExcludedFromBuild="true"
 35086 >
 35087 <Tool
 35088 Name="VCCLCompilerTool"
 35089 />
 35090 </FileConfiguration>
 35091 <FileConfiguration
 35092 Name="Release|Win32"
 35093 ExcludedFromBuild="true"
 35094 >
 35095 <Tool
 35096 Name="VCCLCompilerTool"
 35097 />
 35098 </FileConfiguration>
 35099 <FileConfiguration
 35100 Name="Debug_Cairo_CFLite|Win32"
 35101 ExcludedFromBuild="true"
 35102 >
 35103 <Tool
 35104 Name="VCCLCompilerTool"
 35105 />
 35106 </FileConfiguration>
 35107 <FileConfiguration
 35108 Name="Release_Cairo_CFLite|Win32"
 35109 ExcludedFromBuild="true"
 35110 >
 35111 <Tool
 35112 Name="VCCLCompilerTool"
 35113 />
 35114 </FileConfiguration>
 35115 <FileConfiguration
 35116 Name="Debug_All|Win32"
 35117 ExcludedFromBuild="true"
 35118 >
 35119 <Tool
 35120 Name="VCCLCompilerTool"
 35121 />
 35122 </FileConfiguration>
 35123 <FileConfiguration
 35124 Name="Release_LTCG|Win32"
 35125 ExcludedFromBuild="true"
 35126 >
 35127 <Tool
 35128 Name="VCCLCompilerTool"
 35129 />
 35130 </FileConfiguration>
 35131 </File>
 35132 <File
 35133 RelativePath="..\rendering\RenderQuote.h"
 35134 >
 35135 </File>
 35136 <File
3508135137 RelativePath="..\rendering\RenderReplaced.cpp"
3508235138 >
3508335139 <FileConfiguration

3904739103 >
3904839104 </File>
3904939105 <File
 39106 RelativePath="..\rendering\style\QuotesData.cpp"
 39107 >
 39108 <FileConfiguration
 39109 Name="Debug|Win32"
 39110 ExcludedFromBuild="true"
 39111 >
 39112 <Tool
 39113 Name="VCCLCompilerTool"
 39114 />
 39115 </FileConfiguration>
 39116 <FileConfiguration
 39117 Name="Release|Win32"
 39118 ExcludedFromBuild="true"
 39119 >
 39120 <Tool
 39121 Name="VCCLCompilerTool"
 39122 />
 39123 </FileConfiguration>
 39124 <FileConfiguration
 39125 Name="Debug_Cairo_CFLite|Win32"
 39126 ExcludedFromBuild="true"
 39127 >
 39128 <Tool
 39129 Name="VCCLCompilerTool"
 39130 />
 39131 </FileConfiguration>
 39132 <FileConfiguration
 39133 Name="Release_Cairo_CFLite|Win32"
 39134 ExcludedFromBuild="true"
 39135 >
 39136 <Tool
 39137 Name="VCCLCompilerTool"
 39138 />
 39139 </FileConfiguration>
 39140 <FileConfiguration
 39141 Name="Debug_All|Win32"
 39142 ExcludedFromBuild="true"
 39143 >
 39144 <Tool
 39145 Name="VCCLCompilerTool"
 39146 />
 39147 </FileConfiguration>
 39148 <FileConfiguration
 39149 Name="Release_LTCG|Win32"
 39150 ExcludedFromBuild="true"
 39151 >
 39152 <Tool
 39153 Name="VCCLCompilerTool"
 39154 />
 39155 </FileConfiguration>
 39156 </File>
 39157 <File
 39158 RelativePath="..\rendering\style\QuotesData.h"
 39159 >
 39160 </File>
 39161 <File
3905039162 RelativePath="..\rendering\style\RenderStyle.cpp"
3905139163 >
3905239164 <FileConfiguration

Source/WebCore/WebCore.xcodeproj/project.pbxproj

29042904 9392F1440AD185FE00691BD4 /* RenderCounter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9392F1430AD185FE00691BD4 /* RenderCounter.cpp */; };
29052905 9392F14C0AD1861B00691BD4 /* CounterNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9392F14B0AD1861B00691BD4 /* CounterNode.h */; };
29062906 9392F1500AD1862300691BD4 /* CounterNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9392F14F0AD1862300691BD4 /* CounterNode.cpp */; };
 2907 9392F1420AD185F400691BD4 /* RenderQuote.h in Headers */ = {isa = PBXBuildFile; fileRef = 9392F1410AD185F400691BD4 /* RenderQuote.h */; };
 2908 9392F1440AD185FE00691BD4 /* RenderQuote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9392F1430AD185FE00691BD4 /* RenderQuote.cpp */; };
29072909 939885C308B7E3D100E707C4 /* EventNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 939885C108B7E3D100E707C4 /* EventNames.cpp */; };
29082910 939885C408B7E3D100E707C4 /* EventNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 939885C208B7E3D100E707C4 /* EventNames.h */; settings = {ATTRIBUTES = (Private, ); }; };
29092911 939B02EE0EA2DBC400C54570 /* WidthIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 939B02EC0EA2DBC400C54570 /* WidthIterator.cpp */; };

52615263 BCEF43CF0E673DA1001C1287 /* StyleImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEF43CE0E673DA1001C1287 /* StyleImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
52625264 BCEF43DD0E674012001C1287 /* NinePieceImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEF43DC0E674012001C1287 /* NinePieceImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
52635265 BCEF43E00E674110001C1287 /* NinePieceImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEF43DF0E674110001C1287 /* NinePieceImage.cpp */; };
 5266 9392F1420AD185F400691BD4 /* QuotesData.h in Sources */ = {isa = PBXBuildFile; fileRef = 9392F1420AD185F400691BD4 /* QutoesData.h */; };
 5267 9392F1420AD185F400691BD4 /* QuotesData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9392F1420AD185F400691BD4 /* QutoesData.cpp */; };
52645268 BCEF444A0E6745E0001C1287 /* StyleGeneratedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEF44490E6745E0001C1287 /* StyleGeneratedImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
52655269 BCEF444D0E674628001C1287 /* StyleCachedImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEF444C0E674628001C1287 /* StyleCachedImage.h */; settings = {ATTRIBUTES = (Private, ); }; };
52665270 BCEF447A0E6747D0001C1287 /* StyleCachedImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEF44790E6747D0001C1287 /* StyleCachedImage.cpp */; };

93089312 9392F1430AD185FE00691BD4 /* RenderCounter.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderCounter.cpp; sourceTree = "<group>"; };
93099313 9392F14B0AD1861B00691BD4 /* CounterNode.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CounterNode.h; sourceTree = "<group>"; };
93109314 9392F14F0AD1862300691BD4 /* CounterNode.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CounterNode.cpp; sourceTree = "<group>"; };
 9315 9392F1410AD185F400691BD4 /* RenderQuote.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderQuote.h; sourceTree = "<group>"; };
 9316 9392F1430AD185FE00691BD4 /* RenderQuote.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderQuote.cpp; sourceTree = "<group>"; };
93119317 93955A4103D72932008635CE /* RenderTreeAsText.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = RenderTreeAsText.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
93129318 93955A4203D72932008635CE /* RenderTreeAsText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeAsText.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
93139319 939885C108B7E3D100E707C4 /* EventNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventNames.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };

1159211598 BCEF43CE0E673DA1001C1287 /* StyleImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleImage.h; path = style/StyleImage.h; sourceTree = "<group>"; };
1159311599 BCEF43DC0E674012001C1287 /* NinePieceImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NinePieceImage.h; path = style/NinePieceImage.h; sourceTree = "<group>"; };
1159411600 BCEF43DF0E674110001C1287 /* NinePieceImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NinePieceImage.cpp; path = style/NinePieceImage.cpp; sourceTree = "<group>"; };
 11601 9392F1420AD185F400691BD4 /* QuotesData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuotesData.h; path = style/QuotesData.h; sourceTree = "<group>"; };
 11602 9392F1420AD185F400691BD4 /* QuotesData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = QuotesData.cpp; path = style/QuotesData.cpp; sourceTree = "<group>"; };
1159511603 BCEF44490E6745E0001C1287 /* StyleGeneratedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleGeneratedImage.h; path = style/StyleGeneratedImage.h; sourceTree = "<group>"; };
1159611604 BCEF444C0E674628001C1287 /* StyleCachedImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StyleCachedImage.h; path = style/StyleCachedImage.h; sourceTree = "<group>"; };
1159711605 BCEF44790E6747D0001C1287 /* StyleCachedImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StyleCachedImage.cpp; path = style/StyleCachedImage.cpp; sourceTree = "<group>"; };

1799017998 BCEF43DF0E674110001C1287 /* NinePieceImage.cpp */,
1799117999 BCEF43DC0E674012001C1287 /* NinePieceImage.h */,
1799218000 BC5EB5DC0E81B8DD00B25965 /* OutlineValue.h */,
 18001 9392F1420AD185F400691BD4 /* QuotesData.cpp */,
 18002 9392F1420AD185F400691BD4 /* QuotesData.h */,
1799318003 BC8C8FAB0DDCD31B00B592F4 /* RenderStyle.cpp */,
1799418004 BC8C8FAC0DDCD31B00B592F4 /* RenderStyle.h */,
1799518005 BC5EB6670E81CB7100B25965 /* RenderStyleConstants.h */,

1880818818 A871DECF0A1530C700B12A68 /* RenderPart.h */,
1880918819 A43BF59A1149292800C643CA /* RenderProgress.cpp */,
1881018820 A43BF59B1149292800C643CA /* RenderProgress.h */,
 18821 9392F1430AD185FE00691BD4 /* RenderQuote.cpp */,
 18822 9392F1410AD185F400691BD4 /* RenderQuote.h */,
1881118823 A871DFDE0A15376B00B12A68 /* RenderReplaced.cpp */,
1881218824 A871DFDF0A15376B00B12A68 /* RenderReplaced.h */,
1881318825 BCA846D40DC67A350026C309 /* RenderReplica.cpp */,

2166321675 E4D687790ED7AE4F006EA978 /* PurgeableBuffer.h in Headers */,
2166421676 7E33CD01127F340D00BE8F17 /* PurgePriority.h in Headers */,
2166521677 550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */,
 21678 9392F1420AD185F400691BD4 /* QuotesData.h in Headers */,
2166621679 B22279720D00BF220071B782 /* RadialGradientAttributes.h in Headers */,
2166721680 F55B3DCC1251F12D003EF269 /* RadioInputType.h in Headers */,
2166821681 93F1991808245E59001E9ABC /* Range.h in Headers */,

2173321746 BCFA930810333193007B25D1 /* RenderOverflow.h in Headers */,
2173421747 A871DED70A1530C700B12A68 /* RenderPart.h in Headers */,
2173521748 A43BF59D1149292800C643CA /* RenderProgress.h in Headers */,
 21749 9392F1420AD185F400691BD4 /* RenderQuote.h in Headers */,
2173621750 A871DFE30A15376B00B12A68 /* RenderReplaced.h in Headers */,
2173721751 BCA846D70DC67A350026C309 /* RenderReplica.h in Headers */,
2173821752 1479FAEE109AE37500DED655 /* RenderRuby.h in Headers */,

2438224396 1A7FA61B0DDA3BBE0028F8A5 /* NetworkStateNotifier.cpp in Sources */,
2438324397 1A7FA6490DDA3CBA0028F8A5 /* NetworkStateNotifierMac.cpp in Sources */,
2438424398 BCEF43E00E674110001C1287 /* NinePieceImage.cpp in Sources */,
 24399 9392F1420AD185F400691BD4 /* QuotesData.cpp in Sources */,
2438524400 A8C4A80009D563270003AC8D /* Node.cpp in Sources */,
2438624401 854FE7300A2297BE0058D7AD /* NodeFilter.cpp in Sources */,
2438724402 854FE7320A2297BE0058D7AD /* NodeFilterCondition.cpp in Sources */,

2452324538 BC60EFB70F33A0E700812A93 /* RenderObjectChildList.cpp in Sources */,
2452424539 A871DED00A1530C700B12A68 /* RenderPart.cpp in Sources */,
2452524540 A43BF59C1149292800C643CA /* RenderProgress.cpp in Sources */,
 24541 9392F1440AD185FE00691BD4 /* RenderQuote.cpp in Sources */,
2452624542 A871DFE20A15376B00B12A68 /* RenderReplaced.cpp in Sources */,
2452724543 BCA846D60DC67A350026C309 /* RenderReplica.cpp in Sources */,
2452824544 1479FAED109AE37500DED655 /* RenderRuby.cpp in Sources */,

Source/WebCore/css/CSSParser.cpp

@@bool CSSParser::parseValue(int propId, bool important)
613613 case CSSPropertyQuotes: // [<string> <string>]+ | none | inherit
614614 if (id)
615615 validPrimitive = true;
 616 else
 617 return parseQuotes(propId, important);
616618 break;
617619 case CSSPropertyUnicodeBidi: // normal | embed | bidi-override | inherit
618620 if (id == CSSValueNormal ||

@@CSSParser::SizeParameterType CSSParser::parseSizeParameter(CSSValueList* parsedV
23332335 }
23342336}
23352337
 2338// [ <string> <string> ]+ | inherit | none
 2339// inherit and none are handled in parseValue.
 2340bool CSSParser::parseQuotes(int propId, bool important)
 2341{
 2342 RefPtr<CSSValueList> values = CSSValueList::createCommaSeparated();
 2343 while (CSSParserValue* val = m_valueList->current()) {
 2344 RefPtr<CSSValue> parsedValue;
 2345 if (val->unit == CSSPrimitiveValue::CSS_STRING)
 2346 parsedValue = CSSPrimitiveValue::create(val->string, CSSPrimitiveValue::CSS_STRING);
 2347 else
 2348 break;
 2349 values->append(parsedValue.release());
 2350 m_valueList->next();
 2351 }
 2352 if (values->length()) {
 2353 addProperty(propId, values.release(), important);
 2354 m_valueList->next();
 2355 return true;
 2356 }
 2357 return false;
 2358}
 2359
23362360// [ <string> | <uri> | <counter> | attr(X) | open-quote | close-quote | no-open-quote | no-close-quote ]+ | inherit
23372361// in CSS 2.1 this got somewhat reduced:
23382362// [ <string> | attr(X) | open-quote | close-quote | no-open-quote | no-close-quote ]+ | inherit

Source/WebCore/css/CSSParser.h

@@namespace WebCore {
7878 bool parseShorthand(int propId, const int* properties, int numProperties, bool important);
7979 bool parse4Values(int propId, const int* properties, bool important);
8080 bool parseContent(int propId, bool important);
 81 bool parseQuotes(int propId, bool important);
8182
8283 PassRefPtr<CSSValue> parseAttr(CSSParserValueList* args);
8384

Source/WebCore/css/CSSStyleSelector.cpp

7070#include "PageGroup.h"
7171#include "Pair.h"
7272#include "PerspectiveTransformOperation.h"
 73#include "QuotesData.h"
7374#include "Rect.h"
7475#include "RenderScrollbar.h"
7576#include "RenderScrollbarTheme.h"

@@void CSSStyleSelector::applyProperty(int id, CSSValue *value)
46514652
46524653 CSSPrimitiveValue* contentValue = static_cast<CSSPrimitiveValue*>(item);
46534654 switch (contentValue->primitiveType()) {
4654  case CSSPrimitiveValue::CSS_STRING:
4655  m_style->setContent(contentValue->getStringValue().impl(), didSet);
 4655 case CSSPrimitiveValue::CSS_STRING:
 4656 m_style->setContent(contentValue->getStringValue().impl(), didSet);
 4657 didSet = true;
 4658 break;
 4659 case CSSPrimitiveValue::CSS_ATTR: {
 4660 // FIXME: Can a namespace be specified for an attr(foo)?
 4661 if (m_style->styleType() == NOPSEUDO)
 4662 m_style->setUnique();
 4663 else
 4664 m_parentStyle->setUnique();
 4665 QualifiedName attr(nullAtom, contentValue->getStringValue().impl(), nullAtom);
 4666 m_style->setContent(m_element->getAttribute(attr).impl(), didSet);
 4667 didSet = true;
 4668 // register the fact that the attribute value affects the style
 4669 m_selectorAttrs.add(attr.localName().impl());
 4670 break;
 4671 }
 4672 case CSSPrimitiveValue::CSS_URI: {
 4673 if (!contentValue->isImageValue())
 4674 break;
 4675 m_style->setContent(cachedOrPendingFromValue(CSSPropertyContent, static_cast<CSSImageValue*>(contentValue)), didSet);
 4676 didSet = true;
 4677 break;
 4678 }
 4679 case CSSPrimitiveValue::CSS_COUNTER: {
 4680 Counter* counterValue = contentValue->getCounterValue();
 4681 OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(counterValue->identifier(),
 4682 (EListStyleType)counterValue->listStyleNumber(), counterValue->separator()));
 4683 m_style->setContent(counter.release(), didSet);
 4684 didSet = true;
 4685 break;
 4686 }
 4687 case CSSPrimitiveValue::CSS_IDENT:
 4688 switch (contentValue->getIdent()) {
 4689 case CSSValueOpenQuote:
 4690 m_style->setContent(OPEN_QUOTE, didSet);
46564691 didSet = true;
46574692 break;
4658  case CSSPrimitiveValue::CSS_ATTR: {
4659  // FIXME: Can a namespace be specified for an attr(foo)?
4660  if (m_style->styleType() == NOPSEUDO)
4661  m_style->setUnique();
4662  else
4663  m_parentStyle->setUnique();
4664  QualifiedName attr(nullAtom, contentValue->getStringValue().impl(), nullAtom);
4665  m_style->setContent(m_element->getAttribute(attr).impl(), didSet);
 4693 case CSSValueCloseQuote:
 4694 m_style->setContent(CLOSE_QUOTE, didSet);
46664695 didSet = true;
4667  // register the fact that the attribute value affects the style
4668  m_selectorAttrs.add(attr.localName().impl());
46694696 break;
4670  }
4671  case CSSPrimitiveValue::CSS_URI: {
4672  if (!contentValue->isImageValue())
4673  break;
4674  m_style->setContent(cachedOrPendingFromValue(CSSPropertyContent, static_cast<CSSImageValue*>(contentValue)), didSet);
 4697 case CSSValueNoOpenQuote:
 4698 m_style->setContent(NO_OPEN_QUOTE, didSet);
46754699 didSet = true;
46764700 break;
4677  }
4678  case CSSPrimitiveValue::CSS_COUNTER: {
4679  Counter* counterValue = contentValue->getCounterValue();
4680  OwnPtr<CounterContent> counter = adoptPtr(new CounterContent(counterValue->identifier(),
4681  (EListStyleType)counterValue->listStyleNumber(), counterValue->separator()));
4682  m_style->setContent(counter.release(), didSet);
 4701 case CSSValueNoCloseQuote:
 4702 m_style->setContent(NO_CLOSE_QUOTE, didSet);
46834703 didSet = true;
 4704 break;
 4705 default:
 4706 // normal and none do not have any effect.
 4707 {}
46844708 }
46854709 }
46864710 }

@@void CSSStyleSelector::applyProperty(int id, CSSValue *value)
46884712 m_style->clearContent();
46894713 return;
46904714 }
 4715 case CSSPropertyQuotes:
 4716 if (isInherit) {
 4717 if (m_parentStyle)
 4718 m_style->setQuotes(m_parentStyle->quotes());
 4719 return;
 4720 }
 4721 if (value->isValueList()) {
 4722 CSSValueList* list = static_cast<CSSValueList*>(value);
 4723 int length = list->length();
 4724 QuotesData* data = QuotesData::create(length);
 4725 if (!data)
 4726 return; // Out of memory
 4727 String* quotes = data->data();
 4728 for (int i = 0; i < length; i++) {
 4729 CSSValue* item = list->itemWithoutBoundsCheck(i);
 4730 ASSERT(item->isPrimitiveValue());
 4731 primitiveValue = static_cast<CSSPrimitiveValue*>(item);
 4732 ASSERT(primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_STRING);
 4733 quotes[i] = primitiveValue->getStringValue();
 4734 }
 4735 m_style->setQuotes(adoptRef(data));
 4736 } else if (primitiveValue) {
 4737 ASSERT(primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_IDENT);
 4738 if (primitiveValue->getIdent() == CSSValueNone)
 4739 m_style->setQuotes(adoptRef(QuotesData::create(0)));
 4740 }
 4741 return;
46914742
46924743 case CSSPropertyCounterIncrement:
46934744 applyCounterList(style(), value->isValueList() ? static_cast<CSSValueList*>(value) : 0, false);

@@void CSSStyleSelector::applyProperty(int id, CSSValue *value)
59295980
59305981 case CSSPropertyFontStretch:
59315982 case CSSPropertyPage:
5932  case CSSPropertyQuotes:
59335983 case CSSPropertyTextLineThrough:
59345984 case CSSPropertyTextLineThroughColor:
59355985 case CSSPropertyTextLineThroughMode:

Source/WebCore/css/html.css

@@q {
113113}
114114
115115q:before {
116  content: '"'
117  /* FIXME: content: open-quote; */
 116 content: open-quote;
118117}
119118
120119q:after {
121  content: '"'
122  /* FIXME: content: close-quote; */
 120 content: close-quote;
123121}
124122
125123center {

Source/WebCore/rendering/RenderBlockLineLayout.cpp

@@static inline InlineBox* createInlineBoxForRenderer(RenderObject* obj, bool isRo
177177static inline void dirtyLineBoxesForRenderer(RenderObject* o, bool fullLayout)
178178{
179179 if (o->isText()) {
180  if (o->preferredLogicalWidthsDirty() && o->isCounter())
 180 if (o->preferredLogicalWidthsDirty() && (o->isCounter() || o->isQuote()))
181181 toRenderText(o)->computePreferredLogicalWidths(0); // FIXME: Counters depend on this hack. No clue why. Should be investigated and removed.
182182 toRenderText(o)->dirtyLineBoxes(fullLayout);
183183 } else

Source/WebCore/rendering/RenderObject.h

@@public:
252252 virtual bool isBlockFlow() const { return false; }
253253 virtual bool isBoxModelObject() const { return false; }
254254 virtual bool isCounter() const { return false; }
 255 virtual bool isQuote() const { return false; }
255256 virtual bool isDetails() const { return false; }
256257 virtual bool isDetailsMarker() const { return false; }
257258 virtual bool isEmbeddedObject() const { return false; }

Source/WebCore/rendering/RenderObjectChildList.cpp

3636#include "RenderInline.h"
3737#include "RenderLayer.h"
3838#include "RenderListItem.h"
 39#include "RenderQuote.h"
3940#include "RenderStyle.h"
4041#include "RenderTextFragment.h"
4142#include "RenderView.h"

@@RenderObject* RenderObjectChildList::removeChildNode(RenderObject* owner, Render
130131
131132 if (oldChild->m_hasCounterNodeMap)
132133 RenderCounter::destroyCounterNodes(oldChild);
 134 RenderQuote::rendererRemovedFromTree(oldChild);
133135
134136 if (AXObjectCache::accessibilityEnabled())
135137 owner->document()->axObjectCache()->childrenChanged(owner);

@@void RenderObjectChildList::appendChildNode(RenderObject* owner, RenderObject* n
177179 if (!newChild->isFloatingOrPositioned() && owner->childrenInline())
178180 owner->dirtyLinesFromChangedChild(newChild);
179181 }
180 
181182 RenderCounter::rendererSubtreeAttached(newChild);
 183 RenderQuote::rendererSubtreeAttached(newChild);
182184 newChild->setNeedsLayoutAndPrefWidthsRecalc(); // Goes up the containing block hierarchy.
183185 if (!owner->normalChildNeedsLayout())
184186 owner->setChildNeedsLayout(true); // We may supply the static position for an absolute positioned child.

@@void RenderObjectChildList::insertChildNode(RenderObject* owner, RenderObject* c
239241 }
240242
241243 RenderCounter::rendererSubtreeAttached(child);
 244 RenderQuote::rendererSubtreeAttached(child);
242245 child->setNeedsLayoutAndPrefWidthsRecalc();
243246 if (!owner->normalChildNeedsLayout())
244247 owner->setChildNeedsLayout(true); // We may supply the static position for an absolute positioned child.

@@void RenderObjectChildList::updateBeforeAfterContent(RenderObject* owner, Pseudo
460463 renderer = image;
461464 break;
462465 }
463  case CONTENT_COUNTER:
464  renderer = new (owner->renderArena()) RenderCounter(owner->document(), *content->counter());
465  renderer->setStyle(pseudoElementStyle);
466  break;
 466 case CONTENT_COUNTER:
 467 renderer = new (owner->renderArena()) RenderCounter(owner->document(), *content->counter());
 468 renderer->setStyle(pseudoElementStyle);
 469 break;
 470 case CONTENT_QUOTE:
 471 renderer = new (owner->renderArena()) RenderQuote(owner->document(), content->quote());
 472 renderer->setStyle(pseudoElementStyle);
 473 break;
467474 }
468475
469476 if (renderer) {

Source/WebCore/rendering/RenderQuote.cpp

 1/**
 2 * Copyright (C) 2011 Nokia Inc. All rights reserved.
 3 *
 4 * This library is free software; you can redistribute it and/or
 5 * modify it under the terms of the GNU Library General Public
 6 * License as published by the Free Software Foundation; either
 7 * version 2 of the License, or (at your option) any later version.
 8 *
 9 * This library is distributed in the hope that it will be useful,
 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 12 * Library General Public License for more details.
 13 *
 14 * You should have received a copy of the GNU Library General Public License
 15 * along with this library; see the file COPYING.LIB. If not, write to
 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 17 * Boston, MA 02110-1301, USA.
 18 *
 19 */
 20
 21#include "config.h"
 22#include "RenderQuote.h"
 23
 24#include "Document.h"
 25#include "Element.h"
 26#include "HTMLElement.h"
 27#include "QuotesData.h"
 28#include "RenderStyle.h"
 29#include <algorithm>
 30#include <wtf/text/AtomicString.h>
 31
 32#define UNKNOWN_DEPTH -1
 33
 34namespace WebCore {
 35static inline void adjustDepth(int &depth, QuoteType type)
 36{
 37 switch (type) {
 38 case OPEN_QUOTE:
 39 case NO_OPEN_QUOTE:
 40 ++depth;
 41 break;
 42 case CLOSE_QUOTE:
 43 case NO_CLOSE_QUOTE:
 44 if (depth)
 45 --depth;
 46 break;
 47 default:
 48 ASSERT_NOT_REACHED();
 49 }
 50}
 51
 52RenderQuote::RenderQuote(Document* node, QuoteType quote)
 53 : RenderText(node, StringImpl::empty())
 54 , m_type(quote)
 55 , m_depth(UNKNOWN_DEPTH)
 56 , m_next(0)
 57 , m_previous(0)
 58{
 59}
 60
 61RenderQuote::~RenderQuote()
 62{
 63}
 64
 65const char* RenderQuote::renderName() const
 66{
 67 return "RenderQuote";
 68}
 69
 70// This function places a list of quote renderers starting at "this" in the list of quote renderers already
 71// in the document's renderer tree.
 72// The assumptions are made (for performance):
 73// 1. The list of quotes already in the renderers tree of the document is already in a consistent state
 74// (All quote renderers are linked and have the correct depth set)
 75// 2. The quote renderers of the inserted list are in a tree of renderers of their own which has been just
 76// inserted in the main renderer tree with its root as child of some renderer.
 77// 3. The quote renderers in the inserted list have depths consistent with their position in the list relative
 78// to "this", thus if "this" does not need to change its depth upon insertion, the other renderers in the list don't
 79// need to either.
 80void RenderQuote::placeQuote()
 81{
 82 RenderQuote* head = this;
 83 ASSERT(!head->m_previous);
 84 RenderQuote* tail = 0;
 85 for (RenderObject* predecessor = head->previousInPreOrder(); predecessor; predecessor = predecessor->previousInPreOrder()) {
 86 if (!predecessor->isQuote())
 87 continue;
 88 head->m_previous = toRenderQuote(predecessor);
 89 if (head->m_previous->m_next) {
 90 // We need to splice the list of quotes headed by head into the document's list of quotes.
 91 tail = head;
 92 while (tail->m_next)
 93 tail = tail->m_next;
 94 tail->m_next = head->m_previous->m_next;
 95 ASSERT(tail->m_next->m_previous == head->m_previous);
 96 tail->m_next->m_previous = tail;
 97 tail = tail->m_next; // This marks the splicing point here there may be a depth discontinuity
 98 }
 99 head->m_previous->m_next = head;
 100 ASSERT(head->m_previous->m_depth != UNKNOWN_DEPTH);
 101 break;
 102 }
 103 int newDepth;
 104 if (!head->m_previous) {
 105 newDepth = 0;
 106 goto skipNewDepthCalc;
 107 }
 108 newDepth = head->m_previous->m_depth;
 109 do {
 110 adjustDepth(newDepth, head->m_previous->m_type);
 111skipNewDepthCalc:
 112 if (head->m_depth == newDepth) { // All remaining depth should be correct except if splicing was done.
 113 if (!tail) // We've done the post splicing section already or there was no splicing.
 114 break;
 115 head = tail; // Continue after the splicing point
 116 tail = 0; // Mark the possible splicing point discontinuity fixed.
 117 newDepth = head->m_previous->m_depth;
 118 continue;
 119 }
 120 head->m_depth = newDepth;
 121 // FIXME: If the width and height of the quotation characters does not change we may only need to
 122 // Invalidate the renderer's area not a relayout.
 123 head->setNeedsLayoutAndPrefWidthsRecalc();
 124 head = head->m_next;
 125 if (head == tail) // We are at the splicing point
 126 tail = 0; // Mark the possible depth discontinuity fixed.
 127 } while (head);
 128}
 129
 130#define ARRAY_SIZE(Carray) (sizeof(Carray) / sizeof(*Carray))
 131#define LANGUAGE_DATA(name, languageSourceArray) { name, languageSourceArray, ARRAY_SIZE(languageSourceArray) }
 132#define U(x) ((const UChar*)L##x)
 133
 134static const UChar* simpleQuotes[] = {U("\""), U("\""), U("'"), U("'")};
 135
 136static const UChar* englishQuotes[] = {U("\x201C"), U("\x201D"), U("\x2018"), U("\x2019")};
 137static const UChar* norwegianQuotes[] = { U("\x00AB"), U("\x00BB"), U("\x2039"), U("\x203A") };
 138static const UChar* romanianQuotes[] = { U("\x201E"), U("\x201D")};
 139static const UChar* russianQuotes[] = { U("\x00AB"), U("\x00BB"), U("\x201E"), U("\x201C") };
 140#undef U
 141
 142struct LanguageData {
 143 const char *name;
 144 const UChar* const* const array;
 145 const int arraySize;
 146 bool operator<(const LanguageData& compareTo) const
 147 {
 148 return strcmp(name, compareTo.name);
 149 }
 150};
 151
 152// Data mast be alphabetically sorted and in all lower case for fast comparison
 153LanguageData languageData[] = {
 154 LANGUAGE_DATA("en", englishQuotes),
 155 LANGUAGE_DATA("no", norwegianQuotes),
 156 LANGUAGE_DATA("ro", romanianQuotes),
 157 LANGUAGE_DATA("ru", russianQuotes)
 158};
 159#undef LANGUAGE_DATA
 160const LanguageData* const languageDataEnd = languageData + ARRAY_SIZE(languageData);
 161
 162#define defaultLanguageQuotesSource simpleQuotes
 163#define defaultLanguageQuotesCount ARRAY_SIZE(defaultLanguageQuotesSource)
 164
 165static QuotesData* defaultLanguageQuotesValue = 0;
 166static const QuotesData* defaultLanguageQuotes()
 167{
 168 if (!defaultLanguageQuotesValue) {
 169 defaultLanguageQuotesValue = QuotesData::create(defaultLanguageQuotesCount);
 170 if (!defaultLanguageQuotesValue)
 171 return 0;
 172 String* data = defaultLanguageQuotesValue->data();
 173 for (int i = 0; i < defaultLanguageQuotesCount; ++i)
 174 data[i] = defaultLanguageQuotesSource[i];
 175 }
 176 return defaultLanguageQuotesValue;
 177}
 178#undef defaultLanguageQuotesSource
 179#undef defaultLanguageQuotesCount
 180
 181typedef HashMap<RefPtr<AtomicStringImpl>, QuotesData* > QuotesMap;
 182
 183static QuotesMap& quotesMap()
 184{
 185 DEFINE_STATIC_LOCAL(QuotesMap, staticQuotesMap, ());
 186 return staticQuotesMap;
 187}
 188
 189static const QuotesData* quotesForLanguage(AtomicStringImpl* language)
 190{
 191 QuotesData* returnValue;
 192 AtomicString lower(language->lower());
 193 returnValue = quotesMap().get(lower.impl());
 194 if (returnValue)
 195 return returnValue;
 196 CString s(static_cast<const String&>(lower).ascii());
 197 LanguageData request = { s.buffer()->data(), 0, 0 };
 198 const LanguageData* lowerBound = std::lower_bound<const LanguageData*, const LanguageData>(languageData, languageDataEnd, request);
 199 if (lowerBound == languageDataEnd)
 200 return defaultLanguageQuotes();
 201 if (strncmp(lowerBound->name, request.name, strlen(lowerBound->name)))
 202 return defaultLanguageQuotes();
 203 returnValue = QuotesData::create(lowerBound->arraySize);
 204 if (!returnValue)
 205 return defaultLanguageQuotes();
 206 String* data = returnValue->data();
 207 for (int i = 0; i < lowerBound->arraySize; ++i)
 208 data[i] = lowerBound->array[i];
 209 quotesMap().set(lower.impl(), returnValue);
 210 return returnValue;
 211}
 212#undef ARRAY_SIZE
 213
 214static const QuotesData* defaultQuotes(const RenderObject* object)
 215{
 216 static String langString = "lang";
 217 Node* node = object->generatingNode();
 218 Element* element;
 219 if (!node) {
 220 element = object->document()->body();
 221 if (!element)
 222 element = object->document()->documentElement();
 223 } else if (!node->isElementNode()) {
 224 element = node->parentElement();
 225 if (!element)
 226 return defaultLanguageQuotes();
 227 } else
 228 element = toElement(node);
 229 const AtomicString* language;
 230 while ((language = &element->getAttribute(langString)) && language->isNull()) {
 231 element = element->parentElement();
 232 if (!element)
 233 return defaultLanguageQuotes();
 234 }
 235 return quotesForLanguage(language->impl());
 236}
 237
 238PassRefPtr<StringImpl> RenderQuote::originalText() const
 239{
 240 if (!parent())
 241 return 0;
 242 ASSERT(m_depth != UNKNOWN_DEPTH);
 243 const QuotesData* quotes = style()->quotes();
 244 if (!quotes)
 245 quotes = defaultQuotes(this);
 246 if (!quotes->length)
 247 return emptyAtom.impl();
 248 int index = m_depth * 2;
 249 switch (m_type) {
 250 case NO_OPEN_QUOTE:
 251 case NO_CLOSE_QUOTE:
 252 return String("").impl();
 253 case CLOSE_QUOTE:
 254 if (index)
 255 --index;
 256 else
 257 ++index;
 258 break;
 259 case OPEN_QUOTE:
 260 break;
 261 default:
 262 ASSERT_NOT_REACHED();
 263 return emptyAtom.impl();
 264 }
 265 if (index >= quotes->length)
 266 index = (quotes->length-2) | (index & 1);
 267 if (index < 0)
 268 return emptyAtom.impl();
 269 return quotes->data()[index].impl();
 270}
 271
 272void RenderQuote::computePreferredLogicalWidths(int lead)
 273{
 274 setTextInternal(originalText());
 275 RenderText::computePreferredLogicalWidths(lead);
 276}
 277
 278void RenderQuote::rendererSubtreeAttached(RenderObject* renderer)
 279{
 280 if (renderer->documentBeingDestroyed())
 281 return;
 282 for (RenderObject* descendant = renderer; descendant; descendant = descendant->nextInPreOrder(renderer))
 283 if (descendant->isQuote()) {
 284 toRenderQuote(descendant)->placeQuote();
 285 break;
 286 }
 287}
 288
 289void RenderQuote::rendererRemovedFromTree(RenderObject* subtreeRoot)
 290{
 291 if (subtreeRoot->documentBeingDestroyed())
 292 return;
 293 for (RenderObject* descendant = subtreeRoot; descendant; descendant = descendant->nextInPreOrder(subtreeRoot))
 294 if (descendant->isQuote()) {
 295 RenderQuote* removedQuote = toRenderQuote(descendant);
 296 RenderQuote* lastQuoteBefore = removedQuote->m_previous;
 297 removedQuote->m_previous = 0;
 298 int depth = removedQuote->m_depth;
 299 for (descendant = descendant->nextInPreOrder(subtreeRoot); descendant; descendant = descendant->nextInPreOrder(subtreeRoot))
 300 if (descendant->isQuote())
 301 removedQuote = toRenderQuote(descendant);
 302 RenderQuote* quoteAfter = removedQuote->m_next;
 303 removedQuote->m_next = 0;
 304 if (lastQuoteBefore)
 305 lastQuoteBefore->m_next = quoteAfter;
 306 if (quoteAfter) {
 307 quoteAfter->m_previous = lastQuoteBefore;
 308 do {
 309 if (depth == quoteAfter->m_depth)
 310 break;
 311 quoteAfter->m_depth = depth;
 312 quoteAfter->setNeedsLayoutAndPrefWidthsRecalc();
 313 adjustDepth(depth, quoteAfter->m_type);
 314 quoteAfter = quoteAfter->m_next;
 315 } while (quoteAfter);
 316 }
 317 break;
 318 }
 319}
 320
 321void RenderQuote::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
 322{
 323 const QuotesData* newQuotes = style()->quotes();
 324 const QuotesData* oldQuotes = oldStyle ? oldStyle->quotes() : 0;
 325 if (!((newQuotes && oldQuotes && (*newQuotes == *oldQuotes)) || (!newQuotes && !oldQuotes)))
 326 setNeedsLayoutAndPrefWidthsRecalc();
 327 RenderText::styleDidChange(diff, oldStyle);
 328}
 329
 330} // namespace WebCore

Source/WebCore/rendering/RenderQuote.h

 1/*
 2 * Copyright (C) 2011 Nokia Inc. All rights reserved.
 3 *
 4 * This library is free software; you can redistribute it and/or
 5 * modify it under the terms of the GNU Library General Public
 6 * License as published by the Free Software Foundation; either
 7 * version 2 of the License, or (at your option) any later version.
 8 *
 9 * This library is distributed in the hope that it will be useful,
 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 12 * Library General Public License for more details.
 13 *
 14 * You should have received a copy of the GNU Library General Public License
 15 * along with this library; see the file COPYING.LIB. If not, write to
 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 17 * Boston, MA 02110-1301, USA.
 18 *
 19 */
 20
 21#ifndef RenderQuote_h
 22#define RenderQuote_h
 23
 24#include "RenderStyleConstants.h"
 25#include "RenderText.h"
 26
 27namespace WebCore {
 28
 29class RenderQuote : public RenderText {
 30public:
 31 RenderQuote(Document*, const QuoteType);
 32 virtual ~RenderQuote();
 33
 34 static void rendererSubtreeAttached(RenderObject*);
 35 static void rendererRemovedFromTree(RenderObject*);
 36protected:
 37 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 38private:
 39 virtual const char* renderName() const;
 40 virtual bool isQuote() const { return true; };
 41 virtual PassRefPtr<StringImpl> originalText() const;
 42 virtual void computePreferredLogicalWidths(int leadWidth);
 43 QuoteType m_type;
 44 int m_depth;
 45 RenderQuote* m_next;
 46 RenderQuote* m_previous;
 47 void placeQuote();
 48};
 49
 50inline RenderQuote* toRenderQuote(RenderObject* object)
 51{
 52 ASSERT(!object || object->isQuote());
 53 return static_cast<RenderQuote*>(object);
 54}
 55
 56// This will catch anyone doing an unnecessary cast.
 57void toRenderQuote(const RenderQuote*);
 58
 59} // namespace WebCore
 60
 61#endif // RenderQuote_h

Source/WebCore/rendering/RenderingAllInOne.cpp

7979#include "RenderObjectChildList.cpp"
8080#include "RenderPart.cpp"
8181#include "RenderProgress.cpp"
 82#include "RenderQuote.cpp"
8283#include "RenderReplaced.cpp"
8384#include "RenderReplica.cpp"
8485#include "RenderRuby.cpp"

Source/WebCore/rendering/style/ContentData.cpp

@@bool ContentData::dataEquivalent(const ContentData& other) const
5151 return StyleImage::imagesEquivalent(image(), other.image());
5252 case CONTENT_COUNTER:
5353 return *counter() == *other.counter();
 54 case CONTENT_QUOTE:
 55 return quote() == other.quote();
5456 }
5557
5658 ASSERT_NOT_REACHED();

@@void ContentData::deleteContent()
7173 case CONTENT_COUNTER:
7274 delete m_content.m_counter;
7375 break;
 76 case CONTENT_QUOTE:
 77 break;
7478 }
7579
7680 m_type = CONTENT_NONE;

Source/WebCore/rendering/style/ContentData.h

@@public:
5151 bool isCounter() const { return m_type == CONTENT_COUNTER; }
5252 bool isImage() const { return m_type == CONTENT_OBJECT; }
5353 bool isNone() const { return m_type == CONTENT_NONE; }
 54 bool isQuote() const { return m_type == CONTENT_QUOTE; }
5455 bool isText() const { return m_type == CONTENT_TEXT; }
5556
5657 StyleContentType type() const { return m_type; }

@@public:
9394 m_content.m_counter = counter.leakPtr();
9495 }
9596
 97 QuoteType quote() const
 98 {
 99 ASSERT(isQuote());
 100 return m_content.m_quote;
 101 }
 102 void setQuote(QuoteType type)
 103 {
 104 deleteContent();
 105 m_type = CONTENT_QUOTE;
 106 m_content.m_quote = type;
 107 }
 108
96109 ContentData* next() const { return m_next.get(); }
97110 void setNext(PassOwnPtr<ContentData> next) { m_next = next; }
98111

@@private:
104117 StyleImage* m_image;
105118 StringImpl* m_text;
106119 CounterContent* m_counter;
 120 QuoteType m_quote;
107121 } m_content;
108122 OwnPtr<ContentData> m_next;
109123};

Source/WebCore/rendering/style/QuotesData.cpp

 1/**
 2 * Copyright (C) 2011 Nokia Inc. All rights reserved.
 3 *
 4 * This library is free software; you can redistribute it and/or
 5 * modify it under the terms of the GNU Library General Public
 6 * License as published by the Free Software Foundation; either
 7 * version 2 of the License, or (at your option) any later version.
 8 *
 9 * This library is distributed in the hope that it will be useful,
 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 12 * Library General Public License for more details.
 13 *
 14 * You should have received a copy of the GNU Library General Public License
 15 * along with this library; see the file COPYING.LIB. If not, write to
 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 17 * Boston, MA 02110-1301, USA.
 18 *
 19 */
 20
 21#include "config.h"
 22#include "QuotesData.h"
 23
 24namespace WebCore {
 25
 26QuotesData* QuotesData::create(int stringCount)
 27{
 28 char* tmp = new char[sizeof(QuotesData)+sizeof(String)*stringCount];
 29 if (!tmp)
 30 return 0;
 31 new (tmp) QuotesData(stringCount);
 32 for (int i = 0; i < stringCount; ++i)
 33 new (tmp +sizeof(QuotesData) + sizeof(String)*i) String();
 34 return reinterpret_cast<QuotesData*>(tmp);
 35}
 36
 37bool QuotesData::operator==(const QuotesData& other) const
 38{
 39 if (this == &other)
 40 return true;
 41 if (!&other || !this)
 42 return false;
 43 if (length != other.length)
 44 return false;
 45 const String* myData = data();
 46 const String* otherData = other.data();
 47 for (int i = length-1; i >= 0; --i)
 48 if (myData[i] != otherData[i])
 49 return false;
 50 return true;
 51}
 52
 53QuotesData::~QuotesData()
 54{
 55 String* p = data();
 56 for (int i = 0; i < length; ++i)
 57 p[i].~String();
 58}
 59
 60} // namespace WebCore

Source/WebCore/rendering/style/QuotesData.h

 1/*
 2 * Copyright (C) 2011 Nokia Inc. All rights reserved.
 3 *
 4 * This library is free software; you can redistribute it and/or
 5 * modify it under the terms of the GNU Library General Public
 6 * License as published by the Free Software Foundation; either
 7 * version 2 of the License, or (at your option) any later version.
 8 *
 9 * This library is distributed in the hope that it will be useful,
 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 12 * Library General Public License for more details.
 13 *
 14 * You should have received a copy of the GNU Library General Public License
 15 * along with this library; see the file COPYING.LIB. If not, write to
 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 17 * Boston, MA 02110-1301, USA.
 18 *
 19 */
 20
 21#ifndef QuotesData_h
 22#define QuotesData_h
 23
 24#include <wtf/RefPtr.h>
 25#include <wtf/text/WTFString.h>
 26
 27namespace WebCore {
 28
 29class QuotesData : public RefCounted<QuotesData> {
 30public:
 31 virtual ~QuotesData();
 32 static QuotesData* create(int stringCount);
 33 String* data() { return reinterpret_cast<String*>(this+1); }
 34 const String* data() const { return reinterpret_cast<const String*>(this+1); }
 35 int length;
 36 bool operator==(const QuotesData&) const;
 37 void operator delete(void* p) { delete[] static_cast<char*>(p); }
 38private:
 39 QuotesData(int stringCount) : length(stringCount) {}
 40};
 41
 42}
 43#endif // QuotesData_h

Source/WebCore/rendering/style/RenderStyle.cpp

2727#include "CSSPropertyNames.h"
2828#include "CSSStyleSelector.h"
2929#include "FontSelector.h"
 30#include "QuotesData.h"
3031#include "RenderArena.h"
3132#include "RenderObject.h"
3233#include "ScaleTransformOperation.h"

@@void RenderStyle::setCursorList(PassRefPtr<CursorList> other)
605606 rareInheritedData.access()->cursorData = other;
606607}
607608
 609void RenderStyle::setQuotes(PassRefPtr<QuotesData> q)
 610{
 611 if (*rareInheritedData->quotes.get() == *q.get())
 612 return;
 613 rareInheritedData.access()->quotes = q;
 614}
 615
608616void RenderStyle::clearCursorList()
609617{
610618 if (rareInheritedData->cursorData)

@@void RenderStyle::setContent(PassOwnPtr<CounterContent> counter, bool add)
672680 prepareToSetContent(0, add)->setCounter(counter);
673681}
674682
 683void RenderStyle::setContent(QuoteType quote, bool add)
 684{
 685 prepareToSetContent(0, add)->setQuote(quote);
 686}
 687
675688void RenderStyle::applyTransform(TransformationMatrix& transform, const IntSize& borderBoxSize, ApplyTransformOrigin applyOrigin) const
676689{
677690 // transform-origin brackets the transform with translate operations.

Source/WebCore/rendering/style/RenderStyle.h

@@public:
11271127 void setContent(PassRefPtr<StringImpl>, bool add = false);
11281128 void setContent(PassRefPtr<StyleImage>, bool add = false);
11291129 void setContent(PassOwnPtr<CounterContent>, bool add = false);
 1130 void setContent(QuoteType, bool add = false);
11301131
11311132 const CounterDirectiveMap* counterDirectives() const;
11321133 CounterDirectiveMap& accessCounterDirectives();
11331134
 1135 QuotesData* quotes() const { return rareInheritedData->quotes.get(); }
 1136 void setQuotes(PassRefPtr<QuotesData>);
 1137
11341138 const AtomicString& hyphenString() const;
11351139
11361140 bool inheritedNotEqual(const RenderStyle*) const;

Source/WebCore/rendering/style/RenderStyleConstants.h

@@enum EListStyleType {
297297};
298298
299299enum StyleContentType {
300  CONTENT_NONE, CONTENT_OBJECT, CONTENT_TEXT, CONTENT_COUNTER
 300 CONTENT_NONE, CONTENT_OBJECT, CONTENT_TEXT, CONTENT_COUNTER, CONTENT_QUOTE
 301};
 302
 303enum QuoteType {
 304 OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE
301305};
302306
303307enum EBorderFit { BorderFitBorder, BorderFitLines };

Source/WebCore/rendering/style/StyleRareInheritedData.cpp

2323#include "StyleRareInheritedData.h"
2424
2525#include "CursorList.h"
 26#include "QuotesData.h"
2627#include "RenderStyle.h"
2728#include "RenderStyleConstants.h"
2829#include "ShadowData.h"

@@bool StyleRareInheritedData::operator==(const StyleRareInheritedData& o) const
132133 && textEmphasisPosition == o.textEmphasisPosition
133134 && hyphenationString == o.hyphenationString
134135 && hyphenationLocale == o.hyphenationLocale
135  && textEmphasisCustomMark == o.textEmphasisCustomMark;
 136 && textEmphasisCustomMark == o.textEmphasisCustomMark
 137 && *quotes.get() == *o.quotes.get();
136138}
137139
138140bool StyleRareInheritedData::shadowDataEquivalent(const StyleRareInheritedData& o) const

Source/WebCore/rendering/style/StyleRareInheritedData.h

3434namespace WebCore {
3535
3636class CursorList;
 37class QuotesData;
3738class ShadowData;
3839
3940// This struct is for rarely used inherited CSS3, CSS2, and WebKit-specific properties.

@@public:
8889 AtomicString hyphenationLocale;
8990
9091 AtomicString textEmphasisCustomMark;
 92 RefPtr<QuotesData> quotes;
9193
9294private:
9395 StyleRareInheritedData();