Permalink
Browse files

Fixed problems with sorting css selectors.

Closes #39
  • Loading branch information...
tordex committed Oct 23, 2015
1 parent 583c7e3 commit 7ee5c117324d58afcf43b570c1ef1954bbd57550
Showing with 8 additions and 3 deletions.
  1. +2 −2 src/css_selector.h
  2. +6 −1 src/stylesheet.cpp
@@ -244,12 +244,12 @@ namespace litehtml
return (v1.m_specificity < v2.m_specificity);
}
inline bool operator > (css_selector::ptr v1, css_selector::ptr v2)
inline bool operator >(const css_selector::ptr& v1, const css_selector::ptr& v2)
{
return (*v1 > *v2);
}
inline bool operator < (css_selector::ptr v1, css_selector::ptr v2)
inline bool operator < (const css_selector::ptr& v1, const css_selector::ptr& v2)
{
return (*v1 < *v2);
}
@@ -126,7 +126,12 @@ bool litehtml::css::parse_selectors( const tstring& txt, const litehtml::style::
void litehtml::css::sort_selectors()
{
sort(m_selectors.begin(), m_selectors.end(), std::less<css_selector::ptr>( ));
std::sort(m_selectors.begin(), m_selectors.end(),
[](const css_selector::ptr& v1, const css_selector::ptr& v2)
{
return (*v1) < (*v2);
}
);
}
void litehtml::css::parse_atrule(const tstring& text, const tchar_t* baseurl, const std::shared_ptr<document>& doc, const media_query_list::ptr& media)

0 comments on commit 7ee5c11

Please sign in to comment.