|
From: CVS C. to T. <the...@li...> - 2012-03-21 21:57:02
|
Revision: 689
http://themis.svn.sourceforge.net/themis/?rev=689&view=rev
Author: mark_hellegers
Date: 2012-03-21 21:56:56 +0000 (Wed, 21 Mar 2012)
Log Message:
-----------
- Added support for margin-left.
- Added blockquote styling.
Modified Paths:
--------------
trunk/themis/modules/CSSParser/html4.css
trunk/themis/modules/CSSRenderer/CSSView.cpp
trunk/themis/modules/CSSRenderer/CSSView.hpp
Modified: trunk/themis/modules/CSSParser/html4.css
===================================================================
--- trunk/themis/modules/CSSParser/html4.css 2012-03-21 21:34:13 UTC (rev 688)
+++ trunk/themis/modules/CSSParser/html4.css 2012-03-21 21:56:56 UTC (rev 689)
@@ -36,6 +36,8 @@
HEAD { display: none }
P { display: block;
margin-bottom: 5px }
+BLOCKQUOTE { display: block;
+ margin-left: 10px }
CENTER { display: block }
H1 { display: block;
font-size: 2.5em;
Modified: trunk/themis/modules/CSSRenderer/CSSView.cpp
===================================================================
--- trunk/themis/modules/CSSRenderer/CSSView.cpp 2012-03-21 21:34:13 UTC (rev 688)
+++ trunk/themis/modules/CSSRenderer/CSSView.cpp 2012-03-21 21:56:56 UTC (rev 689)
@@ -96,6 +96,7 @@
mInheritedFont = true;
mMarginBottom = 0;
mMarginRight = 0;
+ mMarginLeft = 0;
mBorderWidth = 0;
mColor = aColor;
mClickable = false;
@@ -448,6 +449,15 @@
}
}
}
+ else if (propertyName == "margin-left") {
+ CSSPrimitiveValuePtr primitiveValue = shared_static_cast<CSSPrimitiveValue>(value);
+ if (primitiveValue.get()) {
+ if (primitiveValue->getPrimitiveType() == CSSPrimitiveValue::CSS_PX) {
+ float floatValue = primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_PX);
+ mMarginLeft = floatValue;
+ }
+ }
+ }
else if (propertyName == "color") {
CSSPrimitiveValuePtr primitiveValue = shared_static_cast<CSSPrimitiveValue>(value);
if (primitiveValue.get()) {
@@ -620,6 +630,7 @@
mRects.clear();
if (mDisplay) {
mRect = aRect;
+ mRect.left += mMarginLeft;
// Enforce the requested width if set
if (mRequestedWidth > -1) {
mRect.right = mRect.left + mRequestedWidth;
Modified: trunk/themis/modules/CSSRenderer/CSSView.hpp
===================================================================
--- trunk/themis/modules/CSSRenderer/CSSView.hpp 2012-03-21 21:34:13 UTC (rev 688)
+++ trunk/themis/modules/CSSRenderer/CSSView.hpp 2012-03-21 21:56:56 UTC (rev 689)
@@ -98,6 +98,7 @@
float mBorderWidth;
float mMarginBottom;
float mMarginRight;
+ float mMarginLeft;
BRect mListStyleRect;
string mListStyleType;
bool mDisplay;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|