RenderRubyRun* RenderRubyRun::staticCreateRubyRun(const RenderObject* parentRuby) { ASSERT(parentRuby && parentRuby->isRuby()); auto renderer = new RenderRubyRun(parentRuby->document(), RenderStyle::createAnonymousStyleWithDisplay(&parentRuby->style(), INLINE_BLOCK)); renderer->initializeStyle(); return renderer; }
RenderNamedFlowThread& FlowThreadController::ensureRenderFlowThreadWithName(const AtomicString& name) { if (!m_renderNamedFlowThreadList) m_renderNamedFlowThreadList = adoptPtr(new RenderNamedFlowThreadList()); else { for (auto iter = m_renderNamedFlowThreadList->begin(), end = m_renderNamedFlowThreadList->end(); iter != end; ++iter) { RenderNamedFlowThread* flowRenderer = *iter; if (flowRenderer->flowThreadName() == name) return *flowRenderer; } } NamedFlowCollection* namedFlows = m_view->document().namedFlows(); // Sanity check for the absence of a named flow in the "CREATED" state with the same name. ASSERT(!namedFlows->flowByName(name)); auto flowRenderer = new RenderNamedFlowThread(m_view->document(), RenderFlowThread::createFlowThreadStyle(&m_view->style()), namedFlows->ensureFlowWithName(name)); flowRenderer->initializeStyle(); m_renderNamedFlowThreadList->add(flowRenderer); // Keep the flow renderer as a child of RenderView. m_view->addChild(flowRenderer); setIsRenderNamedFlowThreadOrderDirty(true); return *flowRenderer; }
/*! * \brief Reads a given file and tries to construct a DOM tree * from that file. If the file is corrupt a exception will be throwed. * \author Ingemar Axelsson (large part of this function is untouched) * * \param filename The file that will be read. */ Stylesheet::Stylesheet(const QString filename) { //read a stylesheet file. doc_ = new QDomDocument("StyleDoc"); QFile file(filename); if(!file.open(QIODevice::ReadOnly)) { // 2005-10-03 AF, thorw exception insted of exit string tmp = "Could not open file: " + filename.toStdString(); throw runtime_error( tmp.c_str() ); } //Här kan det bli feeeeel! if(!doc_->setContent(&file)) { file.close(); // 2005-10-26 AF, thorw exception insted of exit string tmp = "Could not read content from file: " + filename.toStdString() + " Probably some syntax error in the xml file"; throw runtime_error( tmp.c_str() ); } file.close(); // initialize all the styles in the stylesheet file initializeStyle(); }
RenderRubyBase* RenderRubyRun::createRubyBase() const { auto newStyle = RenderStyle::createAnonymousStyleWithDisplay(&style(), BLOCK); newStyle.get().setTextAlign(CENTER); // FIXME: use WEBKIT_CENTER? auto renderer = new RenderRubyBase(document(), std::move(newStyle)); renderer->initializeStyle(); return renderer; }
void LampView::initialize() { // Set default state and color p_ui->onRadioButton->setChecked(false); p_ui->offRadioButton->setChecked(true); p_ui->colorValueLabel->setStyleSheet("background-color:rgb(0,0,0)"); // Initializre qss initializeStyle(); }