aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsgeerken <devnull@localhost>2012-07-06 01:28:44 +0200
committersgeerken <devnull@localhost>2012-07-06 01:28:44 +0200
commit0c3a5744d317e30bce7b6f067c5c3ed25e6fb063 (patch)
tree05860660110ed39d527c271eacb6b1f822344336 /src
parent4253a0888d6154beecc1d64346d0d810dedf5658 (diff)
Attribute "lang" is evaluated for hyphenation; part of dw:core::style::Style.y
Diffstat (limited to 'src')
-rw-r--r--src/css.hh1
-rw-r--r--src/html.cc8
-rw-r--r--src/styleengine.cc7
3 files changed, 16 insertions, 0 deletions
diff --git a/src/css.hh b/src/css.hh
index 532acc01..e81fde62 100644
--- a/src/css.hh
+++ b/src/css.hh
@@ -223,6 +223,7 @@ typedef enum {
CSS_PROPERTY_X_COLSPAN,
CSS_PROPERTY_X_ROWSPAN,
PROPERTY_X_LINK,
+ PROPERTY_X_LANG,
PROPERTY_X_IMG,
PROPERTY_X_TOOLTIP,
CSS_PROPERTY_LAST
diff --git a/src/html.cc b/src/html.cc
index 0cee0a8f..22952609 100644
--- a/src/html.cc
+++ b/src/html.cc
@@ -3440,6 +3440,14 @@ static void Html_parse_common_attrs(DilloHtml *html, char *tag, int tagsize)
html->styleEngine->setStyle (attrbuf);
}
+ if (tagsize >= 10) { /* TODO prefs.hyphenate? */
+ /* length of "<t lang=i>" */
+ attrbuf = Html_get_attr2(html, tag, tagsize, "lang",
+ HTML_LeftTrim | HTML_RightTrim);
+ if (attrbuf)
+ html->styleEngine->setNonCssHint(PROPERTY_X_LANG, CSS_TYPE_STRING,
+ attrbuf);
+ }
}
static void Html_display_block(DilloHtml *html)
diff --git a/src/styleengine.cc b/src/styleengine.cc
index ea251e32..e94a6d6f 100644
--- a/src/styleengine.cc
+++ b/src/styleengine.cc
@@ -601,6 +601,13 @@ void StyleEngine::apply (int i, StyleAttrs *attrs, CssPropertyList *props) {
case PROPERTY_X_LINK:
attrs->x_link = p->value.intVal;
break;
+ case PROPERTY_X_LANG:
+ attrs->x_lang[0] = tolower (p->value.strVal[0]);
+ if (attrs->x_lang[0])
+ attrs->x_lang[1] = tolower (p->value.strVal[1]);
+ else
+ attrs->x_lang[1] = 0;
+ break;
case PROPERTY_X_IMG:
attrs->x_img = p->value.intVal;
break;