3 class MWContentSerializationException
extends MWException
{
9 * A content handler knows how do deal with a specific type of content on a wiki page.
10 * Content is stored in the database in a serialized form (using a serialization format aka mime type)
11 * and is be unserialized into it's native PHP represenation (the content model), which is wrappe in
12 * an instance of the appropriate subclass of Content.
14 * ContentHandler instances are stateless singletons that serve, among other things, as a factory for
15 * Content objects. Generally, there is one subclass of ContentHandler and one subclass of Content
16 * for every type of content model.
18 * Some content types have a flat model, that is, their native represenation is the
19 * same as their serialized form. Examples would be JavaScript and CSS code. As of now,
20 * this also applies to wikitext (mediawiki's default content type), but wikitext
21 * content may be represented by a DOM or AST structure in the future.
25 abstract class ContentHandler
{
28 * Conveniance function for getting flat text from a Content object. This should only
29 * be used in the context of backwards compatibility with code that is not yet able
30 * to handle Content objects!
32 * If $content is null, this method returns the empty string.
34 * If $content is an instance of TextContent, this method returns the flat text as returned by $content->getNativeData().
36 * If $content is not a TextContent object, the bahaviour of this method depends on the global $wgContentHandlerTextFallback:
37 * * If $wgContentHandlerTextFallback is 'fail' and $content is not a TextContent object, an MWException is thrown.
38 * * If $wgContentHandlerTextFallback is 'serialize' and $content is not a TextContent object, $content->serialize()
39 * is called to get a string form of the content.
40 * * If $wgContentHandlerTextFallback is 'ignore' and $content is not a TextContent object, this method returns null.
41 * * otherwise, the behaviour is undefined.
46 * @param Content|null $content
47 * @return null|string the textual form of $content, if available
48 * @throws MWException if $content is not an instance of TextContent and $wgContentHandlerTextFallback was set to 'fail'.
50 public static function getContentText( Content
$content = null ) {
51 global $wgContentHandlerTextFallback;
53 if ( is_null( $content ) ) {
57 if ( $content instanceof TextContent
) {
58 return $content->getNativeData();
61 if ( $wgContentHandlerTextFallback == 'fail' ) {
62 throw new MWException( "Attempt to get text from Content with model " . $content->getModel() );
65 if ( $wgContentHandlerTextFallback == 'serialize' ) {
66 return $content->serialize();
73 * Conveniance function for creating a Content object from a given textual representation.
75 * $text will be deserialized into a Content object of the model specified by $modelId (or,
76 * if that is not given, $title->getContentModel()) using the given format.
81 * @param string $text the textual represenation, will be unserialized to create the Content object
82 * @param Title $title the title of the page this text belongs to, required as a context for deserialization
83 * @param null|String $modelId the model to deserialize to. If not provided, $title->getContentModel() is used.
84 * @param null|String $format the format to use for deserialization. If not given, the model's default format is used.
86 * @return Content a Content object representing $text
87 * @throw MWException if $model or $format is not supported or if $text can not be unserialized using $format.
89 public static function makeContent( $text, Title
$title, $modelId = null, $format = null ) {
91 if ( is_null( $modelId ) ) {
92 $modelId = $title->getContentModel();
95 $handler = ContentHandler
::getForModelID( $modelId );
96 return $handler->unserializeContent( $text, $format );
100 * Returns the name of the default content model to be used for the page with the given title.
102 * Note: There should rarely be need to call this method directly.
103 * To determine the actual content model for a given page, use Title::getContentModel().
105 * Which model is to be used per default for the page is determined based on several factors:
106 * * The global setting $wgNamespaceContentModels specifies a content model per namespace.
107 * * The hook DefaultModelFor may be used to override the page's default model.
108 * * Pages in NS_MEDIAWIKI and NS_USER default to the CSS or JavaScript model if they end in .js or .css, respectively.
109 * * Pages in NS_MEDIAWIKI default to the wikitext model otherwise.
110 * * The hook TitleIsCssOrJsPage may be used to force a page to use the CSS or JavaScript model if they end in .js or .css, respectively.
111 * * The hook TitleIsWikitextPage may be used to force a page to use the wikitext model.
113 * If none of the above applies, the wikitext model is used.
115 * Note: this is used by, and may thus not use, Title::getContentModel()
120 * @param Title $title
121 * @return null|string default model name for the page given by $title
123 public static function getDefaultModelFor( Title
$title ) {
124 global $wgNamespaceContentModels;
126 // NOTE: this method must not rely on $title->getContentModel() directly or indirectly,
127 // because it is used to initialized the mContentModel memebr.
129 $ns = $title->getNamespace();
135 if ( !empty( $wgNamespaceContentModels[ $ns ] ) ) {
136 $model = $wgNamespaceContentModels[ $ns ];
139 // hook can determin default model
140 if ( !wfRunHooks( 'ContentHandlerDefaultModelFor', array( $title, &$model ) ) ) {
141 if ( !is_null( $model ) ) {
146 // Could this page contain custom CSS or JavaScript, based on the title?
147 $isCssOrJsPage = NS_MEDIAWIKI
== $ns && preg_match( '!\.(css|js)$!u', $title->getText(), $m );
148 if ( $isCssOrJsPage ) {
152 // hook can force js/css
153 wfRunHooks( 'TitleIsCssOrJsPage', array( $title, &$isCssOrJsPage ) );
155 // Is this a .css subpage of a user page?
156 $isJsCssSubpage = NS_USER
== $ns && !$isCssOrJsPage && preg_match( "/\\/.*\\.(js|css)$/", $title->getText(), $m );
157 if ( $isJsCssSubpage ) {
161 // is this wikitext, according to $wgNamespaceContentModels or the DefaultModelFor hook?
162 $isWikitext = is_null( $model ) ||
$model == CONTENT_MODEL_WIKITEXT
;
163 $isWikitext = $isWikitext && !$isCssOrJsPage && !$isJsCssSubpage;
165 // hook can override $isWikitext
166 wfRunHooks( 'TitleIsWikitextPage', array( $title, &$isWikitext ) );
168 if ( !$isWikitext ) {
171 return CONTENT_MODEL_JAVASCRIPT
;
173 return CONTENT_MODEL_CSS
;
175 return is_null( $model ) ? CONTENT_MODEL_TEXT
: $model;
179 // we established that is must be wikitext
181 return CONTENT_MODEL_WIKITEXT
;
185 * returns the appropriate ContentHandler singleton for the given title
190 * @param Title $title
191 * @return ContentHandler
193 public static function getForTitle( Title
$title ) {
194 $modelId = $title->getContentModel();
195 return ContentHandler
::getForModelID( $modelId );
199 * returns the appropriate ContentHandler singleton for the given Content object
204 * @param Content $content
205 * @return ContentHandler
207 public static function getForContent( Content
$content ) {
208 $modelId = $content->getModel();
209 return ContentHandler
::getForModelID( $modelId );
213 * returns the ContentHandler singleton for the given model id. Use the CONTENT_MODEL_XXX constants to
214 * identify the desired content model.
216 * ContentHandler singletons are take from the global $wgContentHandlers array. Keys in that array are
217 * model names, the values are either ContentHandler singleton objects, or strings specifying the appropriate
218 * subclass of ContentHandler.
220 * If a class name in encountered when looking up the singleton for a given model name, the class is
221 * instantiated and the class name is replaced by te resulting singleton in $wgContentHandlers.
223 * If no ContentHandler is defined for the desired $modelId, the ContentHandler may be provided by the
224 * a ContentHandlerForModelID hook. if no Contenthandler can be determined, an MWException is raised.
229 * @param $modelId int the id of the content model for which to get a handler. Use CONTENT_MODEL_XXX constants.
230 * @return ContentHandler the ContentHandler singleton for handling the model given by $modelId
231 * @throws MWException if no handler is known for $modelId.
233 public static function getForModelID( $modelId ) {
234 global $wgContentHandlers;
236 if ( empty( $wgContentHandlers[$modelId] ) ) {
239 wfRunHooks( 'ContentHandlerForModelID', array( $modelId, &$handler ) );
241 if ( $handler ) { // NOTE: may be a string or an object, either is fine!
242 $wgContentHandlers[$modelId] = $handler;
244 throw new MWException( "No handler for model #$modelId registered in \$wgContentHandlers" );
248 if ( is_string( $wgContentHandlers[$modelId] ) ) {
249 $class = $wgContentHandlers[$modelId];
250 $wgContentHandlers[$modelId] = new $class( $modelId );
253 return $wgContentHandlers[$modelId];
257 * Returns the appropriate mime type for a given content format,
258 * or null if no mime type is known for this format.
260 * Mime types can be registered in the global array $wgContentFormatMimeTypes.
263 * @param int $id the content format id, as given by a CONTENT_FORMAT_XXX constant
264 * or returned by Revision::getContentFormat().
266 * @return String|null the content format's mime type.
268 public static function getContentFormatMimeType( $id ) {
269 global $wgContentFormatMimeTypes;
271 if ( !isset( $wgContentFormatMimeTypes[ $id ] ) ) {
275 return $wgContentFormatMimeTypes[ $id ];
279 * Returns the content format if for a given mime type,
280 * or null if no format id if known for this mime type.
282 * Mime types can be registered in the global array $wgContentFormatMimeTypes.
285 * @param String $mime the mime type
287 * @return int|null the format id, as defined by a CONTENT_FORMAT_XXX constant
289 public static function getContentFormatID( $mime ) {
290 global $wgContentFormatMimeTypes;
292 static $format_ids = null;
294 if ( $format_ids === null ) {
295 $format_ids = array_flip( $wgContentFormatMimeTypes );
298 if ( !isset( $format_ids[ $mime ] ) ) {
302 return $format_ids[ $mime ];
306 * Returns the localized name for a given content model,
307 * or null of no mime type is known.
309 * Model names are localized using system messages. Message keys
310 * have the form conent-model-$id.
313 * @param int $id the content model id, as given by a CONTENT_MODEL_XXX constant
314 * or returned by Revision::getContentModel().
316 * @return String|null the content format's mime type.
318 public static function getContentModelName( $id ) {
319 $key = "content-model-$id";
321 if ( wfEmptyMsg( $key ) ) return null;
322 else return wfMsg( $key );
325 // ----------------------------------------------------------------------------------------------------------
328 protected $mSupportedFormats;
331 * Constructor, initializing the ContentHandler instance with it's model id and a list of supported formats.
332 * Values for the parameters are typically provided as literals by subclasses' constructors.
334 * @param int $modelId (use CONTENT_MODEL_XXX constants).
335 * @param array $formats list for supported serialization formats (typically as MIME types)
337 public function __construct( $modelId, $formats ) {
338 $this->mModelID
= $modelId;
339 $this->mSupportedFormats
= $formats;
344 * Serializes Content object of the type supported by this ContentHandler.
349 * @param Content $content the Content object to serialize
350 * @param null $format the desired serialization format
351 * @return String serialized form of the content
353 public abstract function serializeContent( Content
$content, $format = null );
356 * Unserializes a Content object of the type supported by this ContentHandler.
361 * @param $blob String serialized form of the content
362 * @param null $format the format used for serialization
363 * @return Content the Content object created by deserializing $blob
365 public abstract function unserializeContent( $blob, $format = null );
368 * Creates an empty Content object of the type supported by this ContentHandler.
374 public abstract function makeEmptyContent();
377 * Returns the model id that identifies the content model this ContentHandler can handle.
378 * Use with the CONTENT_MODEL_XXX constants.
382 * @return int the model id
384 public function getModelID() {
385 return $this->mModelID
;
389 * Throws an MWException if $model_id is not the id of the content model
390 * supported by this ContentHandler.
394 * @param int $model_id the model to check
396 protected function checkModelID( $model_id ) {
397 if ( $model_id !== $this->mModelID
) {
398 $model_name = ContentHandler
::getContentModelName( $model_id );
399 $own_model_name = ContentHandler
::getContentModelName( $this->mModelID
);
401 throw new MWException( "Bad content model: expected {$this->mModelID} ($own_model_name) but got found $model_id ($model_name)." );
406 * Returns a list of serialization formats supported by the serializeContent() and unserializeContent() methods of
407 * this ContentHandler.
411 * @return array of serialization formats as MIME type like strings
413 public function getSupportedFormats() {
414 return $this->mSupportedFormats
;
418 * The format used for serialization/deserialization per default by this ContentHandler.
420 * This default implementation will return the first element of the array of formats
421 * that was passed to the constructor.
425 * @return String the name of the default serialiozation format as a MIME type
427 public function getDefaultFormat() {
428 return $this->mSupportedFormats
[0];
432 * Returns true if $format is a serialization format supported by this ContentHandler,
433 * and false otherwise.
435 * Note that if $format is null, this method always returns true, because null
436 * means "use the default format".
440 * @param String $format the serialization format to check
443 public function isSupportedFormat( $format ) {
446 return true; // this means "use the default"
449 return in_array( $format, $this->mSupportedFormats
);
453 * Throws an MWException if isSupportedFormat( $format ) is not true. Convenient
454 * for checking whether a format provided as a parameter is actually supported.
456 * @param String $format the serialization format to check
458 protected function checkFormat( $format ) {
459 if ( !$this->isSupportedFormat( $format ) ) {
460 throw new MWException( "Format $format is not supported for content model " . $this->getModelID() );
465 * Returns overrides for action handlers.
466 * Classes listed here will be used instead of the default one when
467 * (and only when) $wgActions[$action] === true. This allows subclasses
468 * to override the default action handlers.
474 public function getActionOverrides() {
479 * Return an Article object suitable for viewing the given object
481 * NOTE: does *not* do special handling for Image and Category pages!
482 * Use Article::newFromTitle() for that!
486 * @param Title $title
488 * @todo Article is being refactored into an action class, keep track of that
489 * @todo Article really defines the view of the content... rename this method to createViewPage ?
491 public function createArticle( Title
$title ) {
492 $this->checkModelID( $title->getContentModel() );
494 $article = new Article($title);
499 * Return an EditPage object suitable for editing the given object.
500 * This default implementation always fails with an MWException, because there is no
501 * generic edit page implementation suitable for all content models.
505 * @param Article $article
508 public function createEditPage( Article
$article ) {
509 throw new MWException( "ContentHandler class " . get_classs( $this ) . " does not provide an EditPage." );
513 * Return an ExternalEdit object suitable for editing the given object
517 * @param IContextSource $context
518 * @return ExternalEdit
519 * @todo does anyone or anythign actually use the external edit facility? Can we just deprecate and ignore it?
521 public function createExternalEdit( IContextSource
$context ) {
522 $this->checkModelID( $context->getTitle()->getContentModel() );
524 $externalEdit = new ExternalEdit( $context );
525 return $externalEdit;
532 * @param $context IContextSource context to use, anything else will be ignored
533 * @param $old Integer old ID we want to show and diff with.
534 * @param $new String either 'prev' or 'next'.
535 * @param $rcid Integer ??? FIXME (default 0)
536 * @param $refreshCache boolean If set, refreshes the diff cache
537 * @param $unhide boolean If set, allow viewing deleted revs
539 * @return DifferenceEngine
541 public function createDifferenceEngine( IContextSource
$context, $old = 0, $new = 0, $rcid = 0, #FIMXE: use everywhere!
542 $refreshCache = false, $unhide = false ) {
544 $this->checkModelID( $context->getTitle()->getContentModel() );
546 $diffEngineClass = $this->getDiffEngineClass();
548 return new $diffEngineClass( $context, $old, $new, $rcid, $refreshCache, $unhide );
552 * Returns the name of the diff engine to use.
558 protected function getDiffEngineClass() {
559 return 'DifferenceEngine';
563 * attempts to merge differences between three versions.
564 * Returns a new Content object for a clean merge and false for failure or a conflict.
566 * This default implementation always returns false.
570 * @param $oldContent String
571 * @param $myContent String
572 * @param $yourContent String
573 * @return Content|Bool
575 public function merge3( Content
$oldContent, Content
$myContent, Content
$yourContent ) {
580 * Return an applicable autosummary if one exists for the given edit.
584 * @param $oldContent Content|null: the previous text of the page.
585 * @param $newContent Content|null: The submitted text of the page.
586 * @param $flags Int bitmask: a bitmask of flags submitted for the edit.
588 * @return string An appropriate autosummary, or an empty string.
590 public function getAutosummary( Content
$oldContent = null, Content
$newContent = null, $flags ) {
593 // Decide what kind of autosummary is needed.
595 // Redirect autosummaries
602 $ot = !is_null( $oldContent ) ?
$oldContent->getRedirectTarget() : null;
603 $rt = !is_null( $newContent ) ?
$newContent->getRedirectTarget() : null;
605 if ( is_object( $rt ) && ( !is_object( $ot ) ||
!$rt->equals( $ot ) ||
$ot->getFragment() != $rt->getFragment() ) ) {
607 $truncatedtext = $newContent->getTextForSummary(
609 - strlen( wfMsgForContent( 'autoredircomment' ) )
610 - strlen( $rt->getFullText() ) );
612 return wfMsgForContent( 'autoredircomment', $rt->getFullText(), $truncatedtext );
615 // New page autosummaries
616 if ( $flags & EDIT_NEW
&& $newContent->getSize() > 0 ) {
617 // If they're making a new article, give its text, truncated, in the summary.
619 $truncatedtext = $newContent->getTextForSummary(
620 200 - strlen( wfMsgForContent( 'autosumm-new' ) ) );
622 return wfMsgForContent( 'autosumm-new', $truncatedtext );
625 // Blanking autosummaries
626 if ( !empty( $oldContent ) && $oldContent->getSize() > 0 && $newContent->getSize() == 0 ) {
627 return wfMsgForContent( 'autosumm-blank' );
628 } elseif ( !empty( $oldContent ) && $oldContent->getSize() > 10 * $newContent->getSize() && $newContent->getSize() < 500 ) {
629 // Removing more than 90% of the article
631 $truncatedtext = $newContent->getTextForSummary(
632 200 - strlen( wfMsgForContent( 'autosumm-replace' ) ) );
634 return wfMsgForContent( 'autosumm-replace', $truncatedtext );
637 // If we reach this point, there's no applicable autosummary for our case, so our
638 // autosummary is empty.
644 * Auto-generates a deletion reason
648 * @param $title Title: the page's title
649 * @param &$hasHistory Boolean: whether the page has a history
650 * @return mixed String containing deletion reason or empty string, or boolean false
651 * if no revision occurred
653 * @XXX &$hasHistory is extremely ugly, it's here because WikiPage::getAutoDeleteReason() and Article::getReason() have it / want it.
655 public function getAutoDeleteReason( Title
$title, &$hasHistory ) {
656 $dbw = wfGetDB( DB_MASTER
);
658 // Get the last revision
659 $rev = Revision
::newFromTitle( $title );
661 if ( is_null( $rev ) ) {
665 // Get the article's contents
666 $content = $rev->getContent();
669 // If the page is blank, use the text from the previous revision,
670 // which can only be blank if there's a move/import/protect dummy revision involved
671 if ( $content->getSize() == 0 ) {
672 $prev = $rev->getPrevious();
675 $content = $rev->getContent();
680 // Find out if there was only one contributor
681 // Only scan the last 20 revisions
682 $res = $dbw->select( 'revision', 'rev_user_text',
683 array( 'rev_page' => $title->getArticleID(), $dbw->bitAnd( 'rev_deleted', Revision
::DELETED_USER
) . ' = 0' ),
685 array( 'LIMIT' => 20 )
688 if ( $res === false ) {
689 // This page has no revisions, which is very weird
693 $hasHistory = ( $res->numRows() > 1 );
694 $row = $dbw->fetchObject( $res );
696 if ( $row ) { // $row is false if the only contributor is hidden
697 $onlyAuthor = $row->rev_user_text
;
698 // Try to find a second contributor
699 foreach ( $res as $row ) {
700 if ( $row->rev_user_text
!= $onlyAuthor ) { // Bug 22999
709 // Generate the summary with a '$1' placeholder
711 // The current revision is blank and the one before is also
712 // blank. It's just not our lucky day
713 $reason = wfMsgForContent( 'exbeforeblank', '$1' );
716 $reason = wfMsgForContent( 'excontentauthor', '$1', $onlyAuthor );
718 $reason = wfMsgForContent( 'excontent', '$1' );
722 if ( $reason == '-' ) {
723 // Allow these UI messages to be blanked out cleanly
727 // Max content length = max comment length - length of the comment (excl. $1)
728 $text = $content->getTextForSummary( 255 - ( strlen( $reason ) - 2 ) );
730 // Now replace the '$1' placeholder
731 $reason = str_replace( '$1', $text, $reason );
736 #@TODO: getSecondaryUpdatesForDeletion( Content ) returns an array of DataUpdate objects
737 #... or do that in the Content class?
740 * Get the Content object that needs to be saved in order to undo all revisions
741 * between $undo and $undoafter. Revisions must belong to the same page,
742 * must exist and must not be deleted
746 * @param $current Revision the current text
747 * @param $undo Revision the revision to undo
748 * @param $undoafter Revision Must be an earlier revision than $undo
750 * @return mixed string on success, false on failure
752 public function getUndoContent( Revision
$current, Revision
$undo, Revision
$undoafter ) {
753 $cur_content = $current->getContent();
755 if ( empty( $cur_content ) ) {
756 return false; // no page
759 $undo_content = $undo->getContent();
760 $undoafter_content = $undoafter->getContent();
762 if ( $cur_content->equals( $undo_content ) ) {
763 // No use doing a merge if it's just a straight revert.
764 return $undoafter_content;
767 $undone_content = $this->merge3( $undo_content, $undoafter_content, $cur_content );
769 return $undone_content;
773 * Returns true for content models that support caching using the ParserCache mechanism.
774 * See WikiPage::isParserCacheUser().
780 public function isParserCacheSupported() {
787 * @param $page WikiPage the page that was deleted (note: $page->getId() must still return the old page ID!)
789 * @return array a list of DataUpdate instances that will clean up the database ofter deletion.
791 public function getDeletionUpdates( WikiPage
$page ) {
793 new LinksDeletionUpdate( $page ),
801 abstract class TextContentHandler
extends ContentHandler
{
803 public function __construct( $modelId, $formats ) {
804 parent
::__construct( $modelId, $formats );
808 * Returns the content's text as-is.
810 * @param Content $content
811 * @param String|null $format
814 public function serializeContent( Content
$content, $format = null ) {
815 $this->checkFormat( $format );
816 return $content->getNativeData();
820 * Return an EditPage object for editing the given object
824 * @param Article $article
827 public function createEditPage( Article
$article ) {
828 $this->checkModelID( $article->getPage()->getContentModel() );
830 $editPage = new EditPage( $article );
835 * attempts to merge differences between three versions.
836 * Returns a new Content object for a clean merge and false for failure or a conflict.
838 * All three Content objects passed as parameters must have the same content model.
840 * This text-based implementation uses wfMerge().
842 * @param $oldContent String
843 * @param $myContent String
844 * @param $yourContent String
845 * @return Content|Bool
847 public function merge3( Content
$oldContent, Content
$myContent, Content
$yourContent ) {
848 $this->checkModelID( $oldContent->getModel() );
849 $this->checkModelID( $myContent->getModel() );
850 $this->checkModelID( $yourContent->getModel() );
852 $format = $this->getDefaultFormat();
854 $old = $this->serializeContent( $oldContent, $format );
855 $mine = $this->serializeContent( $myContent, $format );
856 $yours = $this->serializeContent( $yourContent, $format );
858 $ok = wfMerge( $old, $mine, $yours, $result );
865 return $this->makeEmptyContent();
868 $mergedContent = $this->unserializeContent( $result, $format );
869 return $mergedContent;
878 class WikitextContentHandler
extends TextContentHandler
{
880 public function __construct( $modelId = CONTENT_MODEL_WIKITEXT
) {
881 parent
::__construct( $modelId, array( CONTENT_FORMAT_WIKITEXT
) );
884 public function unserializeContent( $text, $format = null ) {
885 $this->checkFormat( $format );
887 return new WikitextContent( $text );
890 public function makeEmptyContent() {
891 return new WikitextContent( '' );
897 #XXX: make ScriptContentHandler base class with plugin interface for syntax highlighting?
902 class JavaScriptContentHandler
extends TextContentHandler
{
904 public function __construct( $modelId = CONTENT_MODEL_JAVASCRIPT
) {
905 parent
::__construct( $modelId, array( CONTENT_FORMAT_JAVASCRIPT
) );
908 public function unserializeContent( $text, $format = null ) {
909 $this->checkFormat( $format );
911 return new JavaScriptContent( $text );
914 public function makeEmptyContent() {
915 return new JavaScriptContent( '' );
922 class CssContentHandler
extends TextContentHandler
{
924 public function __construct( $modelId = CONTENT_MODEL_CSS
) {
925 parent
::__construct( $modelId, array( CONTENT_FORMAT_CSS
) );
928 public function unserializeContent( $text, $format = null ) {
929 $this->checkFormat( $format );
931 return new CssContent( $text );
934 public function makeEmptyContent() {
935 return new CssContent( '' );