| 195 | } |
| 196 | |
| 197 | std::string StyleSheet::print() { |
| 198 | std::string str; |
| 199 | std::map<MediaQueryList::ptr, std::vector<StyleSheetStyle*>> byMQ; |
| 200 | |
| 201 | for ( size_t i = 0; i < mNodes.size(); ++i ) { |
| 202 | auto node = mNodes[i]; |
| 203 | byMQ[node->getMediaQueryList()].emplace_back( node.get() ); |
| 204 | } |
| 205 | |
| 206 | for ( const auto& mq : byMQ ) { |
| 207 | bool first = true; |
| 208 | for ( size_t q = 0; q < mq.second.size(); ++q ) { |
| 209 | const auto& style = mq.second[q]; |
| 210 | str += style->build( first, q == mq.second.size() - 1 ); |
| 211 | first = false; |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | return str; |
| 216 | } |
| 217 | |
| 218 | void StyleSheet::combineStyleSheet( const StyleSheet& styleSheet ) { |
| 219 | for ( auto& style : styleSheet.getStyles() ) { |
no test coverage detected